<template>
  <div v-loading="loading">
    <el-card>
      <div slot="header" class="clearfix text-left">
        <el-col :span="23">
          <span class="title-icon">空运代办事宜</span>
        </el-col>
      </div>

      <el-form
        :inline="true"
        :model="searchCriteria"
        ref="searchCriteria"
        size="mini"
        class="padding-top-sm flex justify-between"
      >
        <el-row :gutter="6">
          <el-col :span="13">
            <el-form-item prop="waybillMergeNos" label="合单号" size="mini">
              <el-input v-model="searchCriteria.waybillMergeNos" type="textarea" placeholder="多个换行"
                        :autosize="{minRows: 5, maxRows: 5}" :style="{width: '100%'}"></el-input>
            </el-form-item>
            <el-form-item prop="waybillNos" label="运单号" size="mini">
              <el-input v-model="searchCriteria.waybillNos" type="textarea" placeholder="多个换行"
                        :autosize="{minRows: 5, maxRows: 5}" :style="{width: '100%'}"></el-input>
            </el-form-item>
            <el-form-item prop="waybillSingleNos" label="分单号" size="mini">
              <el-input v-model="searchCriteria.waybillSingleNos" type="textarea" placeholder="多个换行"
                        :autosize="{minRows: 5, maxRows: 5}" :style="{width: '100%'}"></el-input>
            </el-form-item>
            <el-form-item prop="masterNumbers" label="M单号" size="mini">
              <el-input v-model="searchCriteria.masterNumbers" type="textarea" placeholder="多个换行"
                        :autosize="{minRows: 5, maxRows: 5}" :style="{width: '100%'}"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="11">
            <!-- <span>目的国家:</span> -->
            <el-form-item prop="destinationPort"  label="目的港:">
              <el-select
                v-model="searchCriteria.destinationPort"
                placeholder="请选择目的港"
                clearable
                :style="{ width: '100%' }"
                filterable
              >
                <el-option
                  v-for="(k, v) in configPortOptions"
                  :key="k"
                  :label="configPortOptions[v]"
                  :value="parseInt(v)"
                ></el-option>
              </el-select>
            </el-form-item>
            <el-form-item prop="serviceCompanyId" label="服 务 商 :" v-if="boosyn">
              <el-select
                v-model="searchCriteria.serviceCompanyId"
                placeholder="请选择服务商"
                clearable
                :style="{ width: '100%' }"
                filterable
              >
                <el-option
                  v-for="item in servicerMapList"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                ></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="跟单操作:" prop="operationId" v-if="boosyn">
              <el-select v-model="searchCriteria.operationId" placeholder="请输入关键字搜索"  clearable filterable
                         clearable :style="{width: '100%'}">
                <el-option v-for="(key, value) in userMap" :key="value" :label="key" :value="value"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="11">
            <!-- <span>目的国家:</span> -->
            <el-form-item prop="shipmentPort">
              <div slot="label">起运港:</div>
              <el-select
                v-model="searchCriteria.shipmentPort"
                placeholder="请选择起运港"
                clearable
                :style="{ width: '100%' }"
                filterable
              >
                <el-option
                  v-for="(k, v) in configPortOptions"
                  :key="k"
                  :label="configPortOptions[v]"
                  :value="parseInt(v)"
                ></el-option>
              </el-select>
            </el-form-item>
            <el-form-item prop="customsClearanceAgent" v-if="boosyn">
              <div slot="label">清关代理:</div>
              <el-select
                v-model="searchCriteria.customsClearanceAgent"
                placeholder="请选择清关代理"
                clearable
                :style="{ width: '100%' }"
                filterable
              >
                <el-option
                  v-for="item in servicerMapList"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                ></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="海外操作:" prop="overseasOperatorIds" v-if="boosyn">
              <el-select v-model="searchCriteria.overseasOperatorIds" placeholder="请输入关键字搜索"  clearable filterable
                         clearable :style="{width: '100%'}">
                <el-option v-for="(key, value) in userMap" :key="value" :label="key" :value="value"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="11">
            <el-form-item label="目的仓:" prop="dispatchAddressCode">
              <el-select v-model="searchCriteria.dispatchAddressCode" placeholder="请选择目的仓" clearable filterable
                         :style="{width: '100%'}">
                <el-option v-for="(item, value) in shippingfbastockMap" :key="value" :label="item" :value="item"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="VAT" prop=" vat :">
              <el-input v-model="searchCriteria.vat" placeholder="请输入VAT" clearable
                        :style="{width: '100%'}"></el-input>
            </el-form-item>
            <el-form-item label="EORI" prop="eori:">
              <el-input v-model="searchCriteria.eori" placeholder="请输入EORI" clearable
                        :style="{width: '100%'}"></el-input>
            </el-form-item>
            </el-col>
          <el-col :span="24">
            <el-button-group  v-if="isbooking">
              <el-button type="success" size="mini" @click="batchReportWaybillBookings" >批量导出订舱文件</el-button>
              <el-button type="success" size="mini" @click="batchInputBookings">批量导入</el-button>
            </el-button-group>
            <el-button-group  v-if="isoutStock">
              <el-button type="success" size="mini"  @click="inStockTimeDialogB">批量录入入库时间</el-button>
              <el-button type="success" size="mini" @click="outStockTimeDialogB">批量录入出库时间</el-button>
            </el-button-group>
            <el-button-group v-if="isclearance">
              <el-button type="success" size="mini" @click="batchReportCustomerClearanceFile('',0)">批量下载报关资料</el-button>
            </el-button-group>
            <el-button-group v-if="iswarehousing">
              <el-button type="success" size="mini" @click="batchPassToThePort">批量确认过关到港</el-button>
              <el-button type="success" size="mini" @click="batchConfirmsReceiptGoods">批量确认提货</el-button>
            </el-button-group>
            <el-button-group v-if="iscustomsClearanceAndRelease">
              <el-button type="success" size="mini" @click="batchInputSingleWaybillTime">录入清关放行时间</el-button>
              <el-button type="success" size="mini" @click="batchInputInspectionReason">录入查验信息</el-button>
            </el-button-group>
            <el-button-group v-if="isarrivalStock">
              <el-button type="success" size="mini" @click="batchInputArrivalStockTime">录入到仓时间</el-button>
            </el-button-group>
            <el-button-group v-if="isextract">
              <el-button type="success" size="mini" @click="batchInputDispatchTime">录入提取时间</el-button>
            </el-button-group>
            <el-button-group v-if="issigned">
              <el-button type="success" size="mini" @click="batchInputSignTime">录入签收时间</el-button>
            </el-button-group>
              <div style="float: right">
                <el-button-group>
                  <el-button type="primary" size="mini" @click="searchTaybillTodoList">搜索</el-button>
                </el-button-group>
                <el-button-group>
                  <el-button type="warning" size="mini" @click="reset">重置</el-button>
                </el-button-group>
                <a id="changeQueryA" href="javascript:void(0)" @click="changeQuery()" style="color: #00ADCE">{{queryTypeString}}</a>
              </div>
          </el-col>
        </el-row>
      </el-form>
    </el-card>
    <el-card>
      <el-tabs   type="border-card"  @tab-click="SearchWaybillBox">
        <el-tab-pane label="订舱" name="10" :lazy="true">
          <div>
            <el-main>
              <el-table :data="bookingWaybills"
                        style="width: 100%" size="mini"
                        @selection-change="handleSelectionChange"
                        :header-cell-style="{'text-align':'center'}">
                 <el-table-column align="center"  prop="waybillNo" label="合单号">
                </el-table-column>
                 <el-table-column align="center"  prop="inStockChannel" label="渠道" :render-header="renderHeader" width="120" show-overflow-tooltip>
                  <template slot-scope="scope">
                    <el-popover
                      placement="top"
                      width="400"
                      trigger="click">
                      <el-select
                        v-model="scope.row.inStockChannel"
                        filterable
                        clearable
                        style="width:60%"
                        placeholder="请选择客户渠道"
                      >
                        <el-option
                          v-for="(item, value) in instockChannelMap"
                          :key="value"
                          :label="item"
                          :value="value"
                        />
                      </el-select>
                      <span  slot="reference">{{ instockChannelMap[scope.row.inStockChannel] }}</span>
                    </el-popover>
                  </template>
                </el-table-column>
                 <el-table-column align="center"  prop="countryId" label="国家"  width="45"  :render-header="renderHeader" >
                  <template slot-scope="scope">
                    <el-popover
                      placement="top"
                      width="400"
                      trigger="click">
                      <el-select
                        v-model="scope.row.countryId"
                        filterable
                        clearable
                        style="width:60%"
                        placeholder="请选择"
                      >
                        <el-option
                          v-for="(item, value) in countryMap"
                          :key="value"
                          :label="item"
                          :value="value"
                        />
                      </el-select>
                      <span v-if="countryMap[scope.row.countryId]" slot="reference">{{ countryMap[scope.row.countryId] }}</span>
                      <span v-else  slot="reference">___</span>
                    </el-popover>
                  </template>
                </el-table-column>
                 <el-table-column align="center"  prop="masterNumber" label="M单号"  :render-header="renderHeader" >
                  <template slot-scope="scope">
                    <el-popover
                      placement="top"
                      width="400"
                      trigger="click">
                      <el-input
                        type="text"
                        maxlength="30"
                        v-model="scope.row.masterNumber"
                        style="float: right"
                      ></el-input>
                      <span v-if="scope.row.masterNumber" slot="reference">{{ scope.row.masterNumber }}</span>
                      <span v-else  slot="reference">___</span>
                    </el-popover>
                  </template>
                </el-table-column>
                 <el-table-column align="center" prop="serviceTotalPackages" label="件数" :render-header="renderHeader">
                   <template slot-scope="scope">
                     <el-popover
                       placement="top"
                       width="400"
                       trigger="click">
                       <el-input
                         type="text"
                         maxlength="30"
                         v-model="scope.row.serviceTotalPackages"
                         style="float: right"
                       ></el-input>
                       <span v-if="scope.row.serviceTotalPackages" slot="reference">{{ scope.row.serviceTotalPackages }}</span>
                       <span v-else  slot="reference">___</span>
                     </el-popover>
                   </template>
                 </el-table-column>
                 <el-table-column align="center"  prop="serviceActualWeight" label="实重"  :render-header="renderHeader" >
                   <template slot-scope="scope">
                     <el-popover
                       placement="top"
                       width="400"
                       trigger="click">
                       <el-input
                         type="text"
                         maxlength="30"
                         v-model="scope.row.serviceActualWeight"
                         style="float: right"
                       ></el-input>
                       <span v-if="scope.row.serviceActualWeight" slot="reference">{{ scope.row.serviceActualWeight }}</span>
                       <span v-else  slot="reference">___</span>
                     </el-popover>
                   </template>
                </el-table-column>
                 <el-table-column align="center"  prop="serviceChargedWeight" label="计费重"  :render-header="renderHeader" >
                   <template slot-scope="scope">
                     <el-popover
                       placement="top"
                       width="400"
                       trigger="click">
                       <el-input
                         type="text"
                         maxlength="30"
                         v-model="scope.row.serviceChargedWeight"
                         style="float: right"
                       ></el-input>
                       <span v-if="scope.row.serviceChargedWeight" slot="reference">{{ scope.row.serviceChargedWeight }}</span>
                       <span v-else  slot="reference">___</span>
                     </el-popover>
                   </template>
                </el-table-column>
                 <el-table-column align="center"  prop="serviceVolume" label="体积" :render-header="renderHeader" >
                   <template slot-scope="scope">
                     <el-popover
                       placement="top"
                       width="400"
                       trigger="click">
                       <el-input
                         type="text"
                         maxlength="30"
                         v-model="scope.row.serviceVolume"
                         style="float: right"
                       ></el-input>
                       <span v-if="scope.row.serviceVolume" slot="reference">{{ scope.row.serviceVolume }}</span>
                       <span v-else  slot="reference">___</span>
                     </el-popover>
                   </template>
                </el-table-column>
                 <el-table-column align="center"  prop="shipmentPort" label="起运港" :render-header="renderHeader" show-overflow-tooltip>
                  <template slot-scope="scope">
                    <el-popover
                      placement="top"
                      width="400"
                      trigger="click">
                      <el-select
                        v-model="scope.row.shipmentPort"
                        filterable
                        clearable
                        style="width:60%"
                        placeholder="请选择"
                      >
                        <el-option
                          v-for="(item, value) in configPortOptions"
                          :key="value"
                          :label="item"
                          :value="value"
                        />
                      </el-select>
                      <span v-if="configPortOptions[scope.row.shipmentPort]" slot="reference">{{ configPortOptions[scope.row.shipmentPort] }}</span>
                      <span v-else  slot="reference">___</span>
                    </el-popover>
                  </template>
                </el-table-column>
                 <el-table-column align="center"  prop="transferPort" label="中转港" :render-header="renderHeader" show-overflow-tooltip>
                   <template slot-scope="scope">
                     <el-popover
                       placement="top"
                       width="400"
                       trigger="click">
                       <el-select
                         v-model="scope.row.transferPort"
                         filterable
                         clearable
                         style="width:60%"
                         placeholder="请选择"
                       >
                         <el-option
                           v-for="(item, value) in configPortOptions"
                           :key="value"
                           :label="item"
                           :value="value"
                         />
                       </el-select>
                       <span v-if="configPortOptions[scope.row.transferPort]" slot="reference">{{ configPortOptions[scope.row.transferPort] }}</span>
                       <span v-else  slot="reference">___</span>
                     </el-popover>
                   </template>
                </el-table-column>
                 <el-table-column align="center"  prop="destinationPort" label="目的港" :render-header="renderHeader" show-overflow-tooltip>
                   <template slot-scope="scope">
                     <el-popover
                       placement="top"
                       width="400"
                       trigger="click">
                       <el-select
                         v-model="scope.row.destinationPort"
                         filterable
                         clearable
                         style="width:60%"
                         placeholder="请选择"
                       >
                         <el-option
                           v-for="(item, value) in configPortOptions"
                           :key="value"
                           :label="item"
                           :value="value"
                         />
                       </el-select>
                       <span v-if="configPortOptions[scope.row.destinationPort]" slot="reference">{{ configPortOptions[scope.row.destinationPort] }}</span>
                       <span v-else  slot="reference">___</span>
                     </el-popover>
                   </template>
                </el-table-column>
                 <el-table-column align="center"  prop="shipOrAirlineCompany" label="航司" :render-header="renderHeader" >
                   <template slot-scope="scope">
                     <el-popover
                       placement="top"
                       width="400"
                       trigger="click">
                       <el-select
                         v-model="scope.row.shipOrAirlineCompany"
                         filterable
                         clearable
                         style="width:60%"
                         placeholder="请选择"
                       >
                         <el-option
                           v-for="(item, value) in configAirlineMap"
                           :key="value"
                           :label="item"
                           :value="value"
                         />
                       </el-select>
                       <span v-if="configAirlineMap[scope.row.shipOrAirlineCompany]" slot="reference">{{ configAirlineMap[scope.row.shipOrAirlineCompany] }}</span>
                       <span v-else  slot="reference">___</span>
                     </el-popover>
                   </template>
                </el-table-column>
                 <el-table-column align="center"  prop="flightNumber" label="航班号" :render-header="renderHeader" >
                   <template slot-scope="scope">
                     <el-popover
                       placement="top"
                       width="400"
                       trigger="click">
                       <el-input
                         type="text"
                         maxlength="30"
                         v-model="scope.row.flightNumber"
                         style="float: right"
                       ></el-input>
                       <span v-if="scope.row.flightNumber" slot="reference">{{ scope.row.flightNumber }}</span>
                       <span v-else  slot="reference">___</span>
                     </el-popover>
                   </template>
                </el-table-column>
                 <el-table-column align="center"  prop="leavePortTime" label="离港时间" :render-header="renderHeader" >
                   <template slot-scope="scope">
                     <el-popover
                       placement="top"
                       width="400"
                       trigger="click">
                       <el-date-picker
                         size="mini"
                         v-model="scope.row.leavePortTime"
                         type="date"
                         placeholder="请选择日期"
                         value-format="yyyy-MM-dd"
                       >
                       </el-date-picker>
                       <span v-if="scope.row.leavePortTime" slot="reference">{{ scope.row.leavePortTime }}</span>
                       <span v-else  slot="reference">___</span>
                     </el-popover>
                   </template>
                </el-table-column>
                 <el-table-column align="center"  prop="arrivalPortTime" label="到港时间" :render-header="renderHeader" >
                   <template slot-scope="scope">
                     <el-popover
                       placement="top"
                       width="400"
                       trigger="click">
                       <el-date-picker
                         size="mini"
                         v-model="scope.row.arrivalPortTime"
                         type="date"
                         placeholder="请选择日期"
                         value-format="yyyy-MM-dd"
                       >
                       </el-date-picker>
                       <span v-if="scope.row.arrivalPortTime" slot="reference">{{ scope.row.arrivalPortTime }}</span>
                       <span v-else  slot="reference">___</span>
                     </el-popover>
                   </template>
                </el-table-column>
                 <el-table-column align="center"  prop="operationId" label="跟单操作" :render-header="renderHeader" >
                   <template slot-scope="scope">
                     <el-popover
                       placement="top"
                       width="400"
                       trigger="click">
                       <el-select
                         v-model="scope.row.operationId"
                         filterable
                         clearable
                         style="width:60%"
                         placeholder="请选择"
                       >
                         <el-option
                           v-for="(item, value) in userMap"
                           :key="value"
                           :label="item"
                           :value="value"
                         />
                       </el-select>
                       <span v-if="userMap[scope.row.operationId]" slot="reference">{{ userMap[scope.row.operationId] }}</span>
                       <span v-else  slot="reference">___</span>
                     </el-popover>
                   </template>
                </el-table-column>
                 <el-table-column align="center"  prop="nameDescription" label="英文品名" :render-header="renderHeader" >
                   <template slot-scope="scope">
                     <el-popover
                       placement="top"
                       width="400"
                       trigger="click">
                       <el-input
                         type="text"
                         maxlength="30"
                         v-model="scope.row.nameDescription"
                         style="float: right"
                       ></el-input>
                       <span v-if="scope.row.nameDescription" slot="reference">{{ scope.row.nameDescription }}</span>
                       <span v-else  slot="reference">___</span>
                     </el-popover>
                   </template>
                </el-table-column>
                 <el-table-column align="center"  prop="masterNumberSender" label="Shipper" :render-header="renderHeader" show-overflow-tooltip>
                   <template slot-scope="scope">
                     <el-popover
                       placement="top"
                       width="400"
                       trigger="click">
                       <el-select
                         filterable
                         clearable
                         v-model="masterNumberSender[scope.$index]"
                         placeholder="请输入内容"
                         size="mini"
                       >
                         <el-option
                           v-for="item in servicerMapList"
                           :key="item.value"
                           :label="item.label"
                           :value="item.value"
                           @click.native="selectSenderE('masterNumberSender',item.value,scope.$index)"
                         >
                         </el-option>
                       </el-select>
                       <el-input
                         type="textarea"
                         :autosize="{ minRows: 7, maxRows: 12 }"
                         v-model="scope.row.masterNumberSender"
                         style="float: right"
                       ></el-input>
                       <span v-if="scope.row.masterNumberSender" slot="reference">{{ scope.row.masterNumberSender }}</span>
                       <span v-else  slot="reference">___</span>
                     </el-popover>
                   </template>
                </el-table-column>
                 <el-table-column align="center"  prop="serviceCompanyId" label="服务商" :render-header="renderHeader" show-overflow-tooltip>
                   <template slot-scope="scope">
                     <el-popover
                       placement="top"
                       width="400"
                       trigger="click">
                       <el-select
                         v-model="scope.row.serviceCompanyId"
                         filterable
                         clearable
                         style="width:60%"
                         placeholder="请选择"
                       >
                         <el-option
                           v-for="(item, value) in servicerMap"
                           :key="value"
                           :label="item"
                           :value="value"
                         />
                       </el-select>
                       <span v-if="servicerMap[scope.row.serviceCompanyId]" slot="reference">{{ servicerMap[scope.row.serviceCompanyId] }}</span>
                       <span v-else  slot="reference">___</span>
                     </el-popover>
                   </template>
                </el-table-column>
                <el-table-column align="center"  fixed="right" label="保存" width="100" >
                  <template slot-scope="scope">
                    <a><i class="el-icon-success" @click="saveMergeScope(scope.row)" style="font-size:20px"></i></a>
                  </template>
                </el-table-column>
                 <el-table-column align="center"  fixed="right" label="操作" width="100">
                  <template slot-scope="scope">
                    <el-dropdown>
                      <span class="el-dropdown-link">
                        <i class="el-icon-s-fold" style="font-size:20px"></i>
                      </span>
                      <el-dropdown-menu slot="dropdown">
                        <el-dropdown-item @click.native="previewBooking(scope.row.id)">预览订舱文件</el-dropdown-item>
                        <el-dropdown-item  @click.native="exportBookingDocx(scope.row.id)">下载订舱文件</el-dropdown-item>
                      </el-dropdown-menu>
                    </el-dropdown>
                  </template>
                </el-table-column>
                <el-table-column align="center"
                  type="selection">
                </el-table-column>
              </el-table>
            </el-main>
            <el-footer>
              <el-pagination
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange"
                :current-page="currentPage"
                :page-sizes="[10, 20, 30, 40, 50]"
                :page-size="pageSize"
                layout="total, sizes, prev, pager, next, jumper"
                :total="pageTotal"
              >
              </el-pagination>
            </el-footer>
          </div>
        </el-tab-pane>
        <el-tab-pane label="放舱" name="20"  :lazy="true">
          <div>
            <el-table :data="putTankWaybills" style="width: 100%" size="mini">
               <el-table-column align="center"  prop="waybillNo" label="合单号">
              </el-table-column>
               <el-table-column align="center"  prop="masterNumber" label="M单号">
              </el-table-column>
               <el-table-column align="center"  prop="inStockChannel" label="渠道">
                <template slot-scope="scope">
                  <span>{{ instockChannelMap[scope.row.inStockChannel] }}</span>
                </template>
              </el-table-column>
               <el-table-column align="center"  prop="shipOrAirlineCompany" label="航司" :render-header="renderHeader">
                 <template slot-scope="scope">
                   <el-popover
                     placement="top"
                     width="300"
                     trigger="click">
                     <el-select
                       v-model="scope.row.shipOrAirlineCompany"
                       filterable
                       clearable
                       style="width:60%"
                       placeholder="请选择"
                     >
                       <el-option
                         v-for="(item, value) in configAirlineMap"
                         :key="value"
                         :label="item"
                         :value="value"
                       />
                     </el-select>
                     <span v-if="configAirlineMap[scope.row.shipOrAirlineCompany]" slot="reference">{{ configAirlineMap[scope.row.shipOrAirlineCompany] }}</span>
                     <span v-else  slot="reference">___</span>
                   </el-popover>
                 </template>
              </el-table-column>
               <el-table-column align="center"  prop="flightNumber" label="航班号" :render-header="renderHeader">
                 <template slot-scope="scope">
                   <el-popover
                     placement="top"
                     width="300"
                     trigger="click">
                     <el-input
                       type="text"
                       maxlength="30"
                       v-model="scope.row.flightNumber"
                       style="float: right"
                     ></el-input>
                     <span v-if="scope.row.flightNumber" slot="reference">{{ scope.row.flightNumber }}</span>
                     <span v-else  slot="reference">___</span>
                   </el-popover>
                 </template>
              </el-table-column>
               <el-table-column align="center"  prop="leavePortTime" label="离港时间" :render-header="renderHeader">
                 <template slot-scope="scope">
                   <el-popover
                     placement="top"
                     width="300"
                     trigger="click">
                     <el-date-picker
                       size="mini"
                       v-model="scope.row.leavePortTime"
                       type="date"
                       placeholder="请选择日期"
                       value-format="yyyy-MM-dd"
                     >
                     </el-date-picker>
                     <span v-if="scope.row.leavePortTime" slot="reference">{{ scope.row.leavePortTime }}</span>
                     <span v-else  slot="reference">___</span>
                   </el-popover>
                 </template>
              </el-table-column>
               <el-table-column align="center"  prop="arrivalPortTime" label="到港时间" :render-header="renderHeader">
                 <template slot-scope="scope">
                   <el-popover
                     placement="top"
                     width="300"
                     trigger="click">
                     <el-date-picker
                       size="mini"
                       v-model="scope.row.arrivalPortTime"
                       type="date"
                       placeholder="请选择日期"
                       value-format="yyyy-MM-dd"
                     >
                     </el-date-picker>
                     <span v-if="scope.row.arrivalPortTime" slot="reference">{{ scope.row.arrivalPortTime }}</span>
                     <span v-else  slot="reference">___</span>
                   </el-popover>
                 </template>
              </el-table-column>
              <el-table-column align="center"  fixed="right" label="保存" width="100" >
                <template slot-scope="scope">
                  <a><i class="el-icon-success" @click="saveMergeScope(scope.row)" style="font-size:20px"></i></a>
                </template>
              </el-table-column>
            </el-table>
          </div>
        </el-tab-pane>
        <el-tab-pane label="出库" name="30" :lazy="true">
          <div>
            <el-table :data="outStockWaybills" style="width: 100%" size="mini"
                      @selection-change="handleSelectionChange"
                      :header-cell-style="{'text-align':'center'}">
               <el-table-column align="center"  prop="waybillNo" label="合单号">
              </el-table-column>
               <el-table-column align="center"  prop="masterNumber" label="M单号">
              </el-table-column>
               <el-table-column align="center"  prop="inStockChannel" label="渠道">
                <template slot-scope="scope">
                  <span>{{ instockChannelMap[scope.row.inStockChannel] }}</span>
                </template>
              </el-table-column>
               <el-table-column align="center"   label="总票数">
                <template slot-scope="scope">
                  <span>{{ mergeWaybillMap[scope.row.id].totalCount }}</span>
                </template>
              </el-table-column>
               <el-table-column align="center"   label="已出库数">
                <template slot-scope="scope">
                  <span>{{ mergeWaybillMap[scope.row.id].waybills1Size }}</span>
                </template>
              </el-table-column>
               <el-table-column align="center"   label="未出库数">
                <template slot-scope="scope">
                  <span>{{ mergeWaybillMap[scope.row.id].waybills2Size }}</span>
                </template>
              </el-table-column>
               <el-table-column align="center"   label="出库时间">
                <template slot-scope="scope">
                  <span>{{ mergeWaybillMap[scope.row.id].lastTime }}</span>
                </template>
              </el-table-column>
               <el-table-column align="center"  prop="inStockTime" label="合单入库时间" :render-header="renderHeader">
                 <template slot-scope="scope">
                   <el-popover
                     placement="top"
                     width="300"
                     trigger="click">
                     <el-date-picker
                       size="mini"
                       v-model="scope.row.inStockTime"
                       type="date"
                       placeholder="请选择日期"
                       value-format="yyyy-MM-dd"
                     >
                     </el-date-picker>
                     <span v-if="scope.row.inStockTime" slot="reference">{{ scope.row.inStockTime }}</span>
                     <span v-else  slot="reference">___</span>
                   </el-popover>
                 </template>
              </el-table-column>
               <el-table-column align="center"  prop="outStockTime" label="合单出库时间" :render-header="renderHeader">
                 <template slot-scope="scope">
                   <el-popover
                     placement="top"
                     width="300"
                     trigger="click">
                     <el-date-picker
                       size="mini"
                       v-model="scope.row.outStockTime"
                       type="date"
                       placeholder="请选择日期"
                       value-format="yyyy-MM-dd"
                     >
                     </el-date-picker>
                     <span v-if="scope.row.outStockTime" slot="reference">{{ scope.row.outStockTime }}</span>
                     <span v-else  slot="reference">___</span>
                   </el-popover>
                 </template>
              </el-table-column>
              <el-table-column align="center"  fixed="right" label="保存" width="100" >
                <template slot-scope="scope">
                  <a><i class="el-icon-success" @click="saveMergeScope(scope.row)" style="font-size:20px"></i></a>
                </template>
              </el-table-column>
              <el-table-column align="center" type="selection">
              </el-table-column>
            </el-table>
          </div>
        </el-tab-pane>
        <el-tab-pane label="补料" name="40" :lazy="true">
          <div>
            <el-main>
            <el-table :data="feedingWaybills" style="width: 100%" size="mini"
                      :header-cell-style="{'text-align':'center'}">
               <el-table-column align="center"  prop="waybillNo" label="合单信息">
                <template slot-scope="scope">
                  <div>{{ scope.row.waybillNo }}</div>
                  <div>{{ instockChannelMap[scope.row.inStockChannel] }}</div>
                  <div>{{ scope.row.masterNumber }}</div>
                  <div>{{ userMap[scope.row.operationId] }}</div>
                </template>
              </el-table-column>
               <el-table-column align="center"   label="Shipper" v-if="isfeeding" :render-header="renderHeader">
                <template slot-scope="scope">
                    <el-select
                      filterable
                      clearable
                      v-model="masterNumberSender[scope.$index]"
                      placeholder="请输入内容"
                      size="mini"
                    >
                      <el-option
                        v-for="item in servicerMapList"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value"
                        @click.native="selectSenderM('masterNumberSender',item.value,scope.$index)"
                      >
                      </el-option>
                    </el-select>
                    <el-input
                      type="textarea"
                      :autosize="{ minRows: 7, maxRows: 12 }"
                      v-model="scope.row.masterNumberSender"
                      style="float: right"
                    ></el-input>
                </template>
              </el-table-column>
               <el-table-column align="center"   label="Consignee"  v-if="isfeeding" :render-header="renderHeader">
                <template slot-scope="scope">
                  <el-select
                    filterable
                    placeholder="请输入内容"
                    v-model="masterNumberReceiver[scope.$index]"
                    size="mini"
                  >
                    <el-option
                      v-for="item in servicerMapList"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                      @click.native="selectSenderM('masterNumberReceiver',item.value,scope.$index)"
                    >
                    </el-option>
                  </el-select>
                  <el-input
                    type="textarea"
                    :autosize="{ minRows: 7, maxRows: 12 }"
                    v-model="scope.row.masterNumberReceiver"
                    style="float: right"
                  ></el-input>
                </template>
              </el-table-column>
               <el-table-column align="center"   label="Notify Party"  v-if="isfeeding" :render-header="renderHeader">
                <template slot-scope="scope">
                  <el-select
                    filterable
                    placeholder="请输入内容"
                    v-model="masterNumberNotifier[scope.$index]"
                    size="mini"
                  >
                    <el-option
                      v-for="item in servicerMapList"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                      @click.native="selectSenderM('masterNumberNotifier',item.value,scope.$index)"
                    >
                    </el-option>
                  </el-select>
                  <el-input
                    type="textarea"
                    :autosize="{ minRows: 7, maxRows: 12 }"
                    v-model="scope.row.masterNumberNotifier"
                    style="float: right"
                  ></el-input>
                </template>
              </el-table-column>
               <el-table-column align="center"   label="代理" v-if="isfeeding" :render-header="renderHeader">
                <template slot-scope="scope">
                  <el-select
                    filterable
                    placeholder="请输入内容"
                    v-model="masterNumberAgent[scope.$index]"
                    size="mini"
                  >
                    <el-option
                      v-for="item in servicerMapList"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                      @click.native="selectSenderM('masterNumberAgent',item.value,scope.$index)"
                    >
                    </el-option>
                  </el-select>
                  <el-input
                    type="textarea"
                    :autosize="{ minRows: 7, maxRows: 12 }"
                    v-model="scope.row.masterNumberAgent"
                    style="float: right"
                  ></el-input>
                </template>
              </el-table-column>
               <el-table-column align="center" label="英文品名" :render-header="renderHeader">
                <template slot-scope="scope">
                  <el-button
                    type="text"
                    size="mini"
                    @click="synchronizedProductName(scope.row.id,scope.$index)"
                  >
                    同步品名
                  </el-button>
                  <el-input
                    type="textarea"
                    :autosize="{ minRows: 7, maxRows: 12 }"
                    v-model="scope.row.nameDescription"
                    style="float: right"
                  ></el-input>
                </template>
              </el-table-column>
               <el-table-column align="center"  fixed="right" label="操作" width="100">
                <template slot-scope="scope">
                  <el-dropdown>
                    <span class="el-dropdown-link">
                      <i class="el-icon-s-fold" style="font-size:20px"></i>
                    </span>
                    <el-dropdown-menu slot="dropdown">
                      <el-dropdown-item @click.native="previewM(scope.row)">预览M单</el-dropdown-item>
                      <el-dropdown-item  @click.native="exportM(scope.row)">导出M单</el-dropdown-item>
                    </el-dropdown-menu>
                  </el-dropdown>
                </template>
              </el-table-column>
               <el-table-column align="center"  fixed="right" label="保存" width="100" >
                <template slot-scope="scope">
                  <a><i class="el-icon-success" @click="saveMergeScope(scope.row)" style="font-size:20px"></i></a>
                </template>
              </el-table-column>
            </el-table>
            </el-main>
            <el-footer>
              <el-pagination
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange"
                :current-page="currentPage"
                :page-sizes="[10, 20, 30, 40, 50]"
                :page-size="pageSize"
                layout="total, sizes, prev, pager, next, jumper"
                :total="pageTotal"
              >
              </el-pagination>
            </el-footer>
          </div>
        </el-tab-pane>
        <el-tab-pane label="报关" name="50" :lazy="true">
          <div>
            <el-table :data="clearanceWaybills" style="width: 100%" size="mini"
                      :header-cell-style="{'text-align':'center'}">
               <el-table-column align="center"  prop="waybillNo" label="合单号">
              </el-table-column>
               <el-table-column align="center"  prop="masterNumber" label="M单号">
              </el-table-column>
               <el-table-column align="center"  prop="inStockChannel" label="渠道">
                <template slot-scope="scope">
                  <span>{{ instockChannelMap[scope.row.inStockChannel] }}</span>
                </template>
              </el-table-column>
               <el-table-column align="center"  label="运单号">
                <template slot-scope="scope">
                  <div v-for="item in mergeWaybillMap[scope.row.id].allSingleWaybills">
                    <div>{{ item.waybillNo }}</div>
                  </div>
                </template>
              </el-table-column>
              <el-table-column align="center"  label="选择">
                <template slot-scope="scope">
                  <div  v-for="item in mergeWaybillMap[scope.row.id].allSingleWaybills" style="line-height: 22px">
                    <el-checkbox v-model="item.checked" @change="handleChecked($event, item)"></el-checkbox>
                  </div>
                </template>
              </el-table-column>
               <el-table-column align="center"  label="是否报关">
                <template slot-scope="scope">
                  <div v-for="item in mergeWaybillMap[scope.row.id].allSingleWaybills">
                    <div v-if="item.isCustomerDeclaration==1">是</div>
                    <div v-else>否</div>
                  </div>
                </template>
              </el-table-column>
               <el-table-column align="center"  label="报关资料">
                <template slot-scope="scope">
                  <div v-for="item in mergeWaybillMap[scope.row.id].allSingleWaybills">
                    <div v-if="waybillFileIdMap[item.id]">
                      <a @click="downLoadFile(waybillFileIdMap[item.id][0].fileUrl)">{{waybillFileIdMap[item.id][0].fileName}}</a>
                    </div>
                  </div>
                </template>
              </el-table-column>
               <el-table-column align="center"  label="分单号">
                <template slot-scope="scope">
                  <div v-for="item in mergeWaybillMap[scope.row.id].allSingleWaybills">
                    <span>{{item.waybillSingleNo}}</span>
                  </div>
                </template>
              </el-table-column>
              <el-table-column align="center"  prop="declarationTime" label="报关时间" :render-header="renderHeader">
                <template slot-scope="scope">
                  <el-popover
                    placement="top"
                    width="400"
                    trigger="click">
                    <el-date-picker
                      size="mini"
                      v-model="scope.row.declarationTime"
                      type="date"
                      placeholder="请选择日期"
                      value-format="yyyy-MM-dd"
                    >
                    </el-date-picker>
                    <span v-if="scope.row.declarationTime" slot="reference">{{ scope.row.declarationTime }}</span>
                    <span v-else  slot="reference">___</span>
                  </el-popover>
                </template>
              </el-table-column>
               <el-table-column align="center"   label="客服">
                <template slot-scope="scope">
                  <span>{{ userMap[scope.row.servicesId] }}</span>
                </template>
              </el-table-column>
               <el-table-column align="center"  label="报关服务商">
                <template slot-scope="scope">
                  <span>{{ servicerMap[scope.row.customsBrokerServicer] }}</span>
                </template>
              </el-table-column>
               <el-table-column align="center"  fixed="right" label="操作" width="100">
                <template slot-scope="scope">
                  <el-dropdown>
                    <span class="el-dropdown-link">
                      <i class="el-icon-s-fold" style="font-size:20px"></i>
                    </span>
                    <el-dropdown-menu slot="dropdown">
                      <el-dropdown-item @click.native="batchReportCustomerClearanceFile(mergeWaybillMap[scope.row.id].allSingleWaybills,1)">下载合单报关资料</el-dropdown-item>
                    </el-dropdown-menu>
                  </el-dropdown>
                </template>
              </el-table-column>
              <el-table-column align="center"  fixed="right" label="保存" width="100" >
                <template slot-scope="scope">
                  <a><i class="el-icon-success" @click="saveMergeScope(scope.row)" style="font-size:20px"></i></a>
                </template>
              </el-table-column>
            </el-table>
          </div>
        </el-tab-pane>
        <el-tab-pane label="报关放行" name="60" :lazy="true">
          <div>
            <el-table :data="customsClearanceWaybills" style="width: 100%" size="mini">
               <el-table-column align="center"  prop="waybillNo" label="合单号">
              </el-table-column>
               <el-table-column align="center"  prop="masterNumber" label="M单号">
              </el-table-column>
               <el-table-column align="center"  prop="inStockChannel" label="渠道">
                <template slot-scope="scope">
                  <span>{{ instockChannelMap[scope.row.inStockChannel] }}</span>
                </template>
              </el-table-column>
               <el-table-column align="center"   label="报关放行时间" :render-header="renderHeader">
                 <template slot-scope="scope">
                   <el-popover
                     placement="top"
                     width="400"
                     trigger="click">
                     <el-date-picker
                       size="mini"
                       v-model="scope.row.permitThroughTime"
                       type="date"
                       placeholder="请选择日期"
                       value-format="yyyy-MM-dd"
                     >
                     </el-date-picker>
                     <span v-if="scope.row.permitThroughTime" slot="reference">{{ scope.row.permitThroughTime }}</span>
                     <span v-else  slot="reference">___</span>
                   </el-popover>
                 </template>
              </el-table-column>
               <el-table-column align="center"   label="报关查验时间" :render-header="renderHeader">
                 <template slot-scope="scope">
                   <el-popover
                     placement="top"
                     width="400"
                     trigger="click">
                     <el-date-picker
                       size="mini"
                       v-model="scope.row.departurePortInspectionTime"
                       type="date"
                       placeholder="请选择日期"
                       value-format="yyyy-MM-dd"
                     >
                     </el-date-picker>
                     <span v-if="scope.row.departurePortInspectionTime" slot="reference">{{ scope.row.departurePortInspectionTime }}</span>
                     <span v-else  slot="reference">___</span>
                   </el-popover>
                 </template>
              </el-table-column>
               <el-table-column align="center"  label="报关查验原因" width="500" :render-header="renderHeader">
                <template slot-scope="scope">
                  <el-popover
                    placement="top"
                    width="500"
                    trigger="click">
                    <el-input
                      type="text"
                      maxlength="30"
                      v-model="scope.row.departurePortInspectionReason"
                      style="float: right"
                    ></el-input>
                    <span v-if="scope.row.departurePortInspectionReason" slot="reference">{{ scope.row.departurePortInspectionReason }}</span>
                    <span v-else  slot="reference">___</span>
                  </el-popover>
                </template>
              </el-table-column>
               <el-table-column align="center"   label="通知客户">
                <template slot-scope="scope">
                    <span class="el-dropdown-link">
                      <i class="el-icon-s-promotion" style="font-size:20px" @click="createShipTrace(scope.row,1)"></i>
                    </span>
                </template>
              </el-table-column>
               <el-table-column align="center"  fixed="right" label="保存" width="100" >
                <template slot-scope="scope">
                  <a><i class="el-icon-success" @click="saveMergeScope(scope.row)" style="font-size:20px"></i></a>
                </template>
              </el-table-column>
            </el-table>
          </div>
        </el-tab-pane>
        <el-tab-pane label="货物入仓" name="70" :lazy="true">
          <div>
            <el-table :data="warehousingWaybills" style="width: 100%" size="mini"
                      :header-cell-style="{'text-align':'center'}">
               <el-table-column align="center"  prop="waybillNo" label="合单号">
              </el-table-column>
               <el-table-column align="center"  prop="masterNumber" label="M单号">
              </el-table-column>
               <el-table-column align="center"  prop="inStockChannel" label="渠道">
                <template slot-scope="scope">
                  <span>{{ instockChannelMap[scope.row.inStockChannel] }}</span>
                </template>
              </el-table-column>
               <el-table-column align="center"  label="分单号">
                <template slot-scope="scope">
                  <div v-for="item in mergeWaybillMap[scope.row.id].markedSingleWaybills">
                    <div>{{item.waybillNo}}</div>
                  </div>
                </template>
              </el-table-column>
              <el-table-column align="center" label="选择">
                <template slot-scope="scope">
                  <div  v-for="item in mergeWaybillMap[scope.row.id].markedSingleWaybills" style="line-height: 22px">
                    <el-checkbox v-model="item.checked" @change="handleChecked($event, item)"></el-checkbox>
                  </div>
                </template>
              </el-table-column>
               <el-table-column align="center"  label="件数">
                <template slot-scope="scope">
                  <div v-for="item in mergeWaybillMap[scope.row.id].markedSingleWaybills">
                    <div>{{item.inStockTotalPackages}}</div>
                  </div>
                </template>
              </el-table-column>
               <el-table-column align="center"  label="起运港" show-overflow-tooltip>
                <template slot-scope="scope">
                  <div v-for="item in mergeWaybillMap[scope.row.id].markedSingleWaybills">
                    <div>{{configPortOptions[item.shipmentPort]}}</div>
                  </div>
                </template>
              </el-table-column>
               <el-table-column align="center"  label="是否过关到港" :render-header="renderHeader">
                <template slot-scope="scope">
                  <div v-for="item in mergeWaybillMap[scope.row.id].markedSingleWaybills">
                    <el-popover
                      placement="top"
                      width="300"
                      trigger="click">
                      <el-select
                        v-model="item.isPassToThePort"
                        filterable
                        style="width:60%"
                        placeholder="请选择"
                      >
                        <el-option label="是" value="1"></el-option>
                        <el-option label="否" value="0"></el-option>
                      </el-select>
                      <span v-if="item.isPassToThePort" slot="reference">{{ item.isPassToThePort==1?"是":"否"}}</span>
                      <span v-else  slot="reference">___</span>
                    </el-popover>
                  </div>
                </template>
              </el-table-column>
               <el-table-column align="center"  label="是否代理确认已提货" :render-header="renderHeader">
                <template slot-scope="scope">
                  <div v-for="item in mergeWaybillMap[scope.row.id].markedSingleWaybills">
                    <el-popover
                      placement="top"
                      width="300"
                      trigger="click">
                      <el-select
                        v-model="item.isProxyConfirmsReceiptGoods"
                        filterable
                        style="width:60%"
                        placeholder="请选择"
                      >
                        <el-option label="是" value="1"></el-option>
                        <el-option label="否" value="0"></el-option>
                      </el-select>
                      <span v-if="item.isProxyConfirmsReceiptGoods" slot="reference">{{ item.isProxyConfirmsReceiptGoods==1?"是":"否"}}</span>
                      <span v-else  slot="reference">___</span>
                    </el-popover>
                  </div>
                </template>
              </el-table-column>
               <el-table-column align="center"  label="提货号1" :render-header="renderHeader">
                <template slot-scope="scope">
                  <div v-for="item in mergeWaybillMap[scope.row.id].markedSingleWaybills">
                    <el-popover
                      placement="top"
                      width="400"
                      trigger="click">
                      <el-input
                        type="text"
                        maxlength="30"
                        v-model="item.takeDeliveryNo1"
                        style="float: right"
                      ></el-input>
                      <span v-if="item.takeDeliveryNo1" slot="reference">{{ item.takeDeliveryNo1 }}</span>
                      <span v-else  slot="reference">___</span>
                    </el-popover>
                  </div>
                </template>
              </el-table-column>
               <el-table-column align="center"  label="提货号2" :render-header="renderHeader">
                <template slot-scope="scope">
                  <div v-for="item in mergeWaybillMap[scope.row.id].markedSingleWaybills">
                    <el-popover
                      placement="top"
                      width="400"
                      trigger="click">
                      <el-input
                        type="text"
                        maxlength="30"
                        v-model="item.takeDeliveryNo2"
                        style="float: right"
                      ></el-input>
                      <span v-if="item.takeDeliveryNo2" slot="reference">{{ item.takeDeliveryNo2 }}</span>
                      <span v-else  slot="reference">___</span>
                    </el-popover>
                  </div>
                </template>
              </el-table-column>
               <el-table-column align="center"  label="提货号3" :render-header="renderHeader">
                <template slot-scope="scope">
                  <div v-for="item in mergeWaybillMap[scope.row.id].markedSingleWaybills">
                    <el-popover
                      placement="top"
                      width="400"
                      trigger="click">
                      <el-input
                        type="text"
                        maxlength="30"
                        v-model="item.takeDeliveryNo3"
                        style="float: right"
                      ></el-input>
                      <span v-if="item.takeDeliveryNo3" slot="reference">{{ item.takeDeliveryNo3 }}</span>
                      <span v-else  slot="reference">___</span>
                    </el-popover>
                  </div>
                </template>
              </el-table-column>
               <el-table-column align="center"  fixed="right" label="保存" width="100" >
                <template slot-scope="scope">
                  <a><i class="el-icon-success" @click="saveMergeScope(mergeWaybillMap[scope.row.id].markedSingleWaybills)" style="font-size:20px"></i></a>
                </template>
              </el-table-column>
            </el-table>
          </div>
        </el-tab-pane>
        <el-tab-pane label="清关文件" name="80"  :lazy="true">
          <div>
            <el-table :data="customsClearanceDocumentWaybills" style="width: 100%" size="mini">
               <el-table-column align="center"  prop="waybillNo" label="合单号">
              </el-table-column>
               <el-table-column align="center"  prop="masterNumber" label="M单号">
              </el-table-column>
               <el-table-column align="center"  prop="inStockChannel" label="渠道">
                <template slot-scope="scope">
                  <span>{{ instockChannelMap[scope.row.inStockChannel] }}</span>
                </template>
              </el-table-column>
               <el-table-column align="center"   label="起运港">
                <template slot-scope="scope">
                  <span>{{ configPortOptions[scope.row.shipmentPort] }}</span>
                </template>
              </el-table-column>
               <el-table-column align="center"   label="目的港">
                <template slot-scope="scope">
                  <span>{{ configPortOptions[scope.row.destinationPort] }}</span>
                </template>
              </el-table-column>
               <el-table-column align="center"   label="上传清关文件">
                <template slot-scope="scope">
                  <a style="color: #337ab7" @click="toUploadfile(scope.row)">点击上传清关文件</a>
                  <el-popover
                    placement="top"
                    width="400"
                    trigger="hover">
                    <div v-if="mergeWaybillFiles">
                    <div  v-for="item in mergeWaybillFiles[scope.row.id]">
                      <p>{{item.fileTypeName}} :
                        <a style="color: #337ab7" @click="downLoadFile(item.fileUrl)">{{item.fileName}}</a>
                      </p>
                    </div>
                    </div>
                    <a  slot="reference">查看</a>
                  </el-popover>
                </template>
              </el-table-column>
               <el-table-column align="center"  fixed="right" label="保存" width="100" >
                <template slot-scope="scope">
                  <a><i class="el-icon-success" @click="saveMergeScope(scope.row)" style="font-size:20px"></i></a>
                </template>
              </el-table-column>
            </el-table>
          </div>
        </el-tab-pane>
        <el-tab-pane label="预报文件" name="90"  :lazy="true">
          <div>
            <el-table :data="forecastFileWaybills" style="width: 100%" size="mini">
               <el-table-column align="center"  prop="waybillNo" label="合单号">
              </el-table-column>
               <el-table-column align="center"  prop="masterNumber" label="M单号">
              </el-table-column>
               <el-table-column align="center"  prop="inStockChannel" label="渠道">
                <template slot-scope="scope">
                  <span>{{ instockChannelMap[scope.row.inStockChannel] }}</span>
                </template>
              </el-table-column>
               <el-table-column align="center"   label="起运港">
                <template slot-scope="scope">
                  <span>{{ configPortOptions[scope.row.shipmentPort] }}</span>
                </template>
              </el-table-column>
               <el-table-column align="center"   label="上传预报文件">
                <template slot-scope="scope">
                  <a style="color: #337ab7" @click="toUploadfile(scope.row)">点击上传清关文件</a>
                  <el-popover
                    placement="top"
                    width="400"
                    trigger="hover">
                    <div v-if="mergeWaybillFiles">
                      <div  v-for="item in mergeWaybillFiles[scope.row.id]">
                        <p>{{item.fileTypeName}} :
                          <a style="color: #337ab7" @click="downLoadFile(item.fileUrl)">{{item.fileName}}</a>
                        </p>
                      </div>
                    </div>
                    <a  slot="reference">查看</a>
                  </el-popover>
                </template>
              </el-table-column>
               <el-table-column align="center"  fixed="right" label="保存" width="100" >
                <template slot-scope="scope">
                  <a><i class="el-icon-success" @click="saveMergeScope(scope.row)" style="font-size:20px"></i></a>
                </template>
              </el-table-column>
            </el-table>
          </div>
        </el-tab-pane>
        <el-tab-pane label="具体数据" name="100"  :lazy="true">
          <div>
            <el-main>
              <el-table :data="concreteDataWaybills" style="width: 100%" size="mini">
                 <el-table-column align="center"  prop="waybillNo" label="合单号">
                </el-table-column>
                 <el-table-column align="center"  prop="masterNumber" label="M单号">
                </el-table-column>
                 <el-table-column align="center"  prop="inStockChannel" label="渠道">
                  <template slot-scope="scope">
                    <span>{{ instockChannelMap[scope.row.inStockChannel] }}</span>
                  </template>
                </el-table-column>
                 <el-table-column align="center"  label="件数"  :render-header="renderHeader">
                  <template slot-scope="scope">
                    <el-popover
                      placement="top"
                      width="400"
                      trigger="click">
                      <el-input
                        type="text"
                        maxlength="30"
                        v-model="scope.row.serviceTotalPackages"
                        style="float: right"
                      ></el-input>
                      <span v-if="scope.row.serviceTotalPackages" slot="reference">{{ scope.row.serviceTotalPackages }}</span>
                      <span v-else  slot="reference">___</span>
                    </el-popover>
                  </template>
                </el-table-column>
                 <el-table-column align="center"  label="实重"  :render-header="renderHeader">
                  <template slot-scope="scope">
                    <el-popover
                      placement="top"
                      width="400"
                      trigger="click">
                      <el-input
                        type="text"
                        maxlength="30"
                        v-model="scope.row.serviceActualWeight"
                        style="float: right"
                      ></el-input>
                      <span v-if="scope.row.serviceActualWeight" slot="reference">{{ scope.row.serviceActualWeight }}</span>
                      <span v-else  slot="reference">___</span>
                    </el-popover>
                  </template>
                </el-table-column>
                 <el-table-column align="center"   label="计费重" :render-header="renderHeader">
                  <template slot-scope="scope">
                    <el-popover
                      placement="top"
                      width="400"
                      trigger="click">
                      <el-input
                        type="text"
                        maxlength="30"
                        v-model="scope.row.serviceChargedWeight"
                        style="float: right"
                      ></el-input>
                      <span v-if="scope.row.serviceChargedWeight" slot="reference">{{ scope.row.serviceChargedWeight }}</span>
                      <span v-else  slot="reference">___</span>
                    </el-popover>
                  </template>
                </el-table-column>
                 <el-table-column align="center"   label="体积" :render-header="renderHeader">
                  <template slot-scope="scope">
                    <el-popover
                      placement="top"
                      width="400"
                      trigger="click">
                      <el-input
                        type="text"
                        maxlength="30"
                        v-model="scope.row.serviceVolume"
                        style="float: right"
                      ></el-input>
                      <span v-if="scope.row.serviceVolume" slot="reference">{{ scope.row.serviceVolume }}</span>
                      <span v-else  slot="reference">___</span>
                    </el-popover>
                  </template>
                </el-table-column>
                 <el-table-column align="center"   label="体积重" :render-header="renderHeader">
                  <template slot-scope="scope">
                    <el-popover
                      placement="top"
                      width="400"
                      trigger="click">
                      <el-input
                        type="text"
                        maxlength="30"
                        v-model="scope.row.serviceVolumeWeight"
                        style="float: right"
                      ></el-input>
                      <span v-if="scope.row.serviceVolumeWeight" slot="reference">{{ scope.row.serviceVolumeWeight }}</span>
                      <span v-else  slot="reference">___</span>
                    </el-popover>
                  </template>
                </el-table-column>
                 <el-table-column align="center"  label="单价" :render-header="renderHeader">
                  <template slot-scope="scope">
                    <el-popover
                      placement="top"
                      width="400"
                      trigger="click">
                      <el-input
                        type="text"
                        maxlength="30"
                        v-model="scope.row.serviceUnitPrice"
                        style="float: right"
                      ></el-input>
                      <span v-if="scope.row.serviceUnitPrice" slot="reference">{{ scope.row.serviceUnitPrice }}</span>
                      <span v-else  slot="reference">___</span>
                    </el-popover>
                  </template>
                </el-table-column>
                 <el-table-column align="center"  label="币种" :render-header="renderHeader">
                  <template slot-scope="scope">
                    <el-popover
                      placement="top"
                      width="400"
                      trigger="click">
                      <el-select v-model="scope.row.serviceUnitPriceCurrency" filterable clearable>
                        <el-option
                          v-for="(item, value) in currencyMap"
                          :key="value"
                          :value="value"
                          :label="item"
                        >
                        </el-option>
                      </el-select>
                      <span v-if="scope.row.serviceUnitPriceCurrency" slot="reference">{{ scope.row.serviceUnitPriceCurrency }}</span>
                      <span v-else  slot="reference">___</span>
                    </el-popover>
                  </template>
                </el-table-column>
                 <el-table-column align="center"  prop="shipmentPort" label="起运港" :render-header="renderHeader">
                  <template slot-scope="scope">
                    <el-popover
                      placement="top"
                      width="400"
                      trigger="click">
                      <el-select
                        v-model="scope.row.shipmentPort"
                        filterable
                        clearable
                        style="width:60%"
                        placeholder="请选择"
                      >
                        <el-option
                          v-for="(item, value) in configPortOptions"
                          :key="value"
                          :label="item"
                          :value="value"
                        />
                      </el-select>
                      <span v-if="configPortOptions[scope.row.shipmentPort]" slot="reference">{{ configPortOptions[scope.row.shipmentPort] }}</span>
                      <span v-else  slot="reference">___</span>
                    </el-popover>
                  </template>
                </el-table-column>
                 <el-table-column align="center"  prop="transferPort" label="中转港" :render-header="renderHeader">
                  <template slot-scope="scope">
                    <el-popover
                      placement="top"
                      width="400"
                      trigger="click">
                      <el-select
                        v-model="scope.row.transferPort"
                        filterable
                        clearable
                        style="width:60%"
                        placeholder="请选择"
                      >
                        <el-option
                          v-for="(item, value) in configPortOptions"
                          :key="value"
                          :label="item"
                          :value="value"
                        />
                      </el-select>
                      <span v-if="configPortOptions[scope.row.transferPort]" slot="reference">{{ configPortOptions[scope.row.transferPort] }}</span>
                      <span v-else  slot="reference">___</span>
                    </el-popover>
                  </template>
                </el-table-column>
                 <el-table-column align="center"  prop="destinationPort" label="目的港" :render-header="renderHeader">
                  <template slot-scope="scope">
                    <el-popover
                      placement="top"
                      width="400"
                      trigger="click">
                      <el-select
                        v-model="scope.row.destinationPort"
                        filterable
                        clearable
                        style="width:60%"
                        placeholder="请选择"
                      >
                        <el-option
                          v-for="(item, value) in configPortOptions"
                          :key="value"
                          :label="item"
                          :value="value"
                        />
                      </el-select>
                      <span v-if="configPortOptions[scope.row.destinationPort]" slot="reference">{{ configPortOptions[scope.row.destinationPort] }}</span>
                      <span v-else  slot="reference">___</span>
                    </el-popover>
                  </template>
                </el-table-column>
                 <el-table-column align="center"  prop="shipOrAirlineCompany" label="航司" :render-header="renderHeader">
                  <template slot-scope="scope">
                    <el-popover
                      placement="top"
                      width="400"
                      trigger="click">
                      <el-select
                        v-model="scope.row.shipOrAirlineCompany"
                        filterable
                        clearable
                        style="width:60%"
                        placeholder="请选择"
                      >
                        <el-option
                          v-for="(item, value) in configAirlineMap"
                          :key="value"
                          :label="item"
                          :value="value"
                        />
                      </el-select>
                      <span v-if="configAirlineMap[scope.row.shipOrAirlineCompany]" slot="reference">{{ configAirlineMap[scope.row.shipOrAirlineCompany] }}</span>
                      <span v-else  slot="reference">___</span>
                    </el-popover>
                  </template>
                </el-table-column>
                 <el-table-column align="center"   label="备注">
                  <template slot-scope="scope">
                    <el-popover
                      placement="right"
                      width="400"
                      trigger="hover">
                        <div style="max-width:500px;overflow:auto;background: #e1e5e8;font-size: 15px;line-height: 16px;color: #888;max-height: 320px;" v-html="scope.row.sysRemark"></div>
                      <a  slot="reference">查看</a>
                    </el-popover>
                      <a  slot="reference" @click="showRemarkForm(scope.row.id)">| 新增</a>
                  </template>
                </el-table-column>
                 <el-table-column align="center"  fixed="right" label="保存" width="100" >
                  <template slot-scope="scope">
                    <a><i class="el-icon-success" @click="saveMergeScope(scope.row)" style="font-size:20px"></i></a>
                  </template>
                </el-table-column>
              </el-table>
            </el-main>
            <el-footer>
              <el-pagination
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange"
                :current-page="currentPage"
                :page-sizes="[10, 20, 30, 40, 50]"
                :page-size="pageSize"
                layout="total, sizes, prev, pager, next, jumper"
                :total="pageTotal"
              >
              </el-pagination>
            </el-footer>
          </div>
        </el-tab-pane>
        <el-tab-pane label="离港" name="105" :lazy="true">
          <div>
            <el-table :data="leavePortWaybills" style="width: 100%" size="mini">
               <el-table-column align="center"  prop="waybillNo" label="合单号">
              </el-table-column>
               <el-table-column align="center"  prop="masterNumber" label="M单号">
              </el-table-column>
               <el-table-column align="center"  prop="inStockChannel" label="渠道">
                <template slot-scope="scope">
                  <span>{{ instockChannelMap[scope.row.inStockChannel] }}</span>
                </template>
              </el-table-column>
               <el-table-column align="center"  prop="leavePortTime" label="离港时间" :render-header="renderHeader">
                <template slot-scope="scope">
                  <el-popover
                    placement="top"
                    width="400"
                    trigger="click">
                    <el-date-picker
                      size="mini"
                      v-model="scope.row.leavePortTime"
                      type="date"
                      placeholder="请选择日期"
                      value-format="yyyy-MM-dd"
                    >
                    </el-date-picker>
                    <span v-if="scope.row.leavePortTime" slot="reference">{{ scope.row.leavePortTime }}</span>
                    <span v-else  slot="reference">___</span>
                  </el-popover>
                </template>
              </el-table-column>
               <el-table-column align="center"  label="备注" width="800"  :render-header="renderHeader">
                <template slot-scope="scope">
                    <div  v-html="scope.row.sysRemark" @click="showRemarkForm(scope.row.id)"></div>
                </template>
              </el-table-column>
               <el-table-column align="center"  fixed="right" label="保存" width="100" >
                <template slot-scope="scope">
                  <a> <i class="el-icon-success" @click="saveMergeScope(scope.row)" style="font-size:20px"></i></a>
                </template>
              </el-table-column>
            </el-table>
          </div>
        </el-tab-pane>
        <el-tab-pane label="到港" name="110" :lazy="true">
          <div>
            <el-table :data="arrivalPortWaybills" style="width: 100%" size="mini">
               <el-table-column align="center"  prop="waybillNo" label="合单号">
              </el-table-column>
               <el-table-column align="center"  prop="masterNumber" label="M单号">
              </el-table-column>
               <el-table-column align="center"  prop="inStockChannel" label="渠道">
                <template slot-scope="scope">
                  <span>{{ instockChannelMap[scope.row.inStockChannel] }}</span>
                </template>
              </el-table-column>
               <el-table-column align="center"  prop="arrivalPortTime" label="到港时间" :render-header="renderHeader">
                <template slot-scope="scope">
                  <el-popover
                    placement="top"
                    width="400"
                    trigger="click">
                    <el-date-picker
                      size="mini"
                      v-model="scope.row.arrivalPortTime"
                      type="date"
                      placeholder="请选择日期"
                      value-format="yyyy-MM-dd"
                    >
                    </el-date-picker>
                    <span v-if="scope.row.arrivalPortTime" slot="reference">{{ scope.row.arrivalPortTime }}</span>
                    <span v-else  slot="reference">___</span>
                  </el-popover>
                </template>
              </el-table-column>
               <el-table-column align="center"  label="备注" width="800" :render-header="renderHeader">
                <template slot-scope="scope">
                  <div  v-html="scope.row.sysRemark"  @click="showRemarkForm(scope.row.id)"></div>
                </template>
              </el-table-column>
               <el-table-column align="center"  fixed="right" label="保存" width="100" >
                <template slot-scope="scope">
                  <a><i class="el-icon-success" @click="saveMergeScope(scope.row)" style="font-size:20px"></i></a>
                </template>
              </el-table-column>
            </el-table>
          </div>
        </el-tab-pane>
        <el-tab-pane label="清关" name="120" :lazy="true">
          <div>
            <el-table :data="customsLiquidationWaybills" style="width: 100%" size="mini">
               <el-table-column align="center"  prop="waybillNo" label="合单号">
              </el-table-column>
               <el-table-column align="center"  prop="masterNumber" label="M单号">
              </el-table-column>
               <el-table-column align="center"  prop="inStockChannel" label="渠道">
                <template slot-scope="scope">
                  <span>{{ instockChannelMap[scope.row.inStockChannel] }}</span>
                </template>
              </el-table-column>
               <el-table-column align="center"  prop="clearanceTime" label="清关时间" :render-header="renderHeader">
                <template slot-scope="scope">
                  <el-popover
                    placement="top"
                    width="400"
                    trigger="click">
                    <el-date-picker
                      size="mini"
                      v-model="scope.row.clearanceTime"
                      type="date"
                      placeholder="请选择日期"
                      value-format="yyyy-MM-dd"
                    >
                    </el-date-picker>
                    <span v-if="scope.row.clearanceTime" slot="reference">{{ scope.row.clearanceTime }}</span>
                    <span v-else  slot="reference">___</span>
                  </el-popover>
                </template>
              </el-table-column>
               <el-table-column align="center"  fixed="right" label="保存" width="100" >
                <template slot-scope="scope">
                  <a><i class="el-icon-success" @click="saveMergeScope(scope.row)" style="font-size:20px"></i></a>
                </template>
              </el-table-column>
            </el-table>
          </div>
        </el-tab-pane>
        <el-tab-pane label="清关放行" name="130" :lazy="true">
          <div>
            <el-main>
              <el-table :data="customsClearanceAndReleaseWaybills" style="width: 100%" size="mini"
                        :header-cell-style="{'text-align':'center'}">
                 <el-table-column align="center"  prop="waybillNo" label="合单号">
                </el-table-column>
                 <el-table-column align="center"  prop="masterNumber" label="M单号">
                </el-table-column>
                 <el-table-column align="center"  prop="inStockChannel" label="渠道">
                  <template slot-scope="scope">
                    <span>{{ instockChannelMap[scope.row.inStockChannel] }}</span>
                  </template>
                </el-table-column>
                 <el-table-column align="center"  prop="inStockChannel" label="状态">
                  <template slot-scope="scope">
                    <span>{{ m(statusMap[scope.row.status]) }}</span>
                  </template>
                </el-table-column>
                 <el-table-column align="center"   label="清关放行时间" :render-header="renderHeader">
                  <template slot-scope="scope">
                    <el-popover
                      placement="top"
                      width="400"
                      trigger="click">
                      <el-date-picker
                        size="mini"
                        v-model="scope.row.clearanceReleaseTime"
                        type="date"
                        placeholder="请选择日期"
                        value-format="yyyy-MM-dd"
                      >
                      </el-date-picker>
                      <span v-if="scope.row.clearanceReleaseTime" slot="reference">{{ scope.row.clearanceReleaseTime }}</span>
                      <span v-else  slot="reference">___</span>
                    </el-popover>
                  </template>
                </el-table-column>
                 <el-table-column align="center"   label="清关查验时间" :render-header="renderHeader">
                  <template slot-scope="scope">
                    <el-popover
                      placement="top"
                      width="400"
                      trigger="click">
                      <el-date-picker
                        size="mini"
                        v-model="scope.row.arrivalPortInspectionTime"
                        type="date"
                        placeholder="请选择日期"
                        value-format="yyyy-MM-dd"
                      >
                      </el-date-picker>
                      <span v-if="scope.row.arrivalPortInspectionTime" slot="reference">{{ scope.row.arrivalPortInspectionTime }}</span>
                      <span v-else  slot="reference">___</span>
                    </el-popover>
                  </template>
                </el-table-column>
                 <el-table-column align="center"  label="清关查验备注" :render-header="renderHeader">
                  <template slot-scope="scope">
                    <el-popover
                      placement="top"
                      width="400"
                      trigger="click">
                      <el-input
                        type="text"
                        maxlength="30"
                        v-model="scope.row.arrivalPortInspectionReason"
                        style="float: right"
                      ></el-input>
                      <span v-if="scope.row.arrivalPortInspectionReason" slot="reference">{{ scope.row.arrivalPortInspectionReason }}</span>
                      <span v-else  slot="reference">___</span>
                    </el-popover>
                  </template>
                </el-table-column>
                 <el-table-column align="center"   label="通知客户" :render-header="renderHeader">
                  <template slot-scope="scope">
                      <span class="el-dropdown-link">
                        <i class="el-icon-s-promotion" style="font-size:20px" @click="createShipTrace(scope.row,1)"></i>
                      </span>
                  </template>
                </el-table-column>
                 <el-table-column align="center"  label="分单号">
                  <template slot-scope="scope">
                    <div v-for="item in mergeWaybillMap[scope.row.id].allSingleWaybills">
                      <span>{{item.waybillSingleNo}}</span>
                    </div>
                  </template>
                </el-table-column>
                 <el-table-column align="center"  label="运单号">
                  <template slot-scope="scope">
                    <div v-for="item in mergeWaybillMap[scope.row.id].allSingleWaybills">
                      <span>{{item.waybillNo}}</span>
                    </div>
                  </template>
                </el-table-column>
                <el-table-column align="center"  label="选择">
                  <template slot-scope="scope">
                    <div  v-for="item in mergeWaybillMap[scope.row.id].allSingleWaybills" style="line-height: 22px">
                      <el-checkbox v-model="item.checked" @change="handleChecked($event, item)"></el-checkbox>
                    </div>
                  </template>
                </el-table-column>
                 <el-table-column align="center"  label="当前状态">
                  <template slot-scope="scope">
                    <div v-for="item in mergeWaybillMap[scope.row.id].allSingleWaybills">
                      <span>{{m(statusMap[item.status]) }}</span>
                    </div>
                  </template>
                </el-table-column>
                 <el-table-column align="center"  label="件数">
                  <template slot-scope="scope">
                    <div v-for="item in mergeWaybillMap[scope.row.id].allSingleWaybills">
                      <span>{{item.inStockTotalPackages }}</span>
                    </div>
                  </template>
                </el-table-column>
                 <el-table-column align="center"  label="仓库代码">
                  <template slot-scope="scope">
                    <div v-for="item in mergeWaybillMap[scope.row.id].allSingleWaybills">
                      <span>{{item.dispatchAddressCode }}</span>
                    </div>
                  </template>
                </el-table-column>
                 <el-table-column align="center"  label="派送方式">
                  <template slot-scope="scope">
                    <div v-for="item in mergeWaybillMap[scope.row.id].allSingleWaybills">
                      <span v-if="item.trackNumber">{{item.trackNumber}}</span>
                      <span v-else>卡车派送</span>
                    </div>
                  </template>
                </el-table-column>
                 <el-table-column align="center"  fixed="right" label="保存" width="100" >
                  <template slot-scope="scope">
                    <a><i class="el-icon-success" @click="saveMergeScope(scope.row)" style="font-size:20px"></i></a>
                  </template>
                </el-table-column>
              </el-table>
            </el-main>
            <el-footer>
              <el-pagination
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange"
                :current-page="currentPage"
                :page-sizes="[10, 20, 30, 40, 50]"
                :page-size="pageSize"
                layout="total, sizes, prev, pager, next, jumper"
                :total="pageTotal"
              >
              </el-pagination>
            </el-footer>
          </div>
        </el-tab-pane>
        <el-tab-pane label="到仓" name="135" :lazy="true">
          <div>
            <el-main>
              <el-table :data="arrivalStockWaybills" style="width: 100%" size="mini"
                        :header-cell-style="{'text-align':'center'}">
                 <el-table-column align="center"  prop="waybillNo" label="合单号">
                </el-table-column>
                 <el-table-column align="center"  prop="masterNumber" label="M单号">
                </el-table-column>
                 <el-table-column align="center"  prop="inStockChannel" label="渠道">
                  <template slot-scope="scope">
                    <span>{{ instockChannelMap[scope.row.inStockChannel] }}</span>
                  </template>
                </el-table-column>
                 <el-table-column align="center"  prop="inStockChannel" label="状态">
                  <template slot-scope="scope">
                    <span>{{ m(statusMap[scope.row.status]) }}</span>
                  </template>
                </el-table-column>
                 <el-table-column align="center"   label="到仓时间"  :render-header="renderHeader">
                  <template slot-scope="scope">
                    <el-popover
                      placement="top"
                      width="400"
                      trigger="click">
                      <el-date-picker
                        size="mini"
                        v-model="scope.row.arrivalStockTime"
                        type="date"
                        placeholder="请选择日期"
                        value-format="yyyy-MM-dd"
                      >
                      </el-date-picker>
                      <span v-if="scope.row.arrivalStockTime" slot="reference">{{ scope.row.arrivalStockTime }}</span>
                      <span v-else  slot="reference">___</span>
                    </el-popover>
                  </template>
                </el-table-column>
                 <el-table-column align="center"  label="分单号">
                  <template slot-scope="scope">
                    <div v-for="item in mergeWaybillMap[scope.row.id].allSingleWaybills">
                      <span>{{item.waybillSingleNo}}</span>
                    </div>
                  </template>
                </el-table-column>
                 <el-table-column align="center"  label="运单号">
                  <template slot-scope="scope">
                    <div v-for="item in mergeWaybillMap[scope.row.id].allSingleWaybills">
                      <span>{{item.waybillNo}}</span>
                    </div>
                  </template>
                </el-table-column>
                <el-table-column align="center" label="选择" >
                  <template slot-scope="scope">
                    <div  v-for="item in mergeWaybillMap[scope.row.id].allSingleWaybills" style="line-height: 22px">
                      <el-checkbox v-model="item.checked" @change="handleChecked($event, item)"></el-checkbox>
                    </div>
                  </template>
                </el-table-column>
                 <el-table-column align="center"  label="当前状态">
                  <template slot-scope="scope">
                    <div v-for="item in mergeWaybillMap[scope.row.id].allSingleWaybills">
                      <span>{{m(statusMap[item.status]) }}</span>
                    </div>
                  </template>
                </el-table-column>
                 <el-table-column align="center"  label="上一个轨迹时间" width="200">
                  <template slot-scope="scope">
                    <div v-for="item in mergeWaybillMap[scope.row.id].allSingleWaybills">
                      <span v-if="item.status==105">到港时间：{{item.arrivalPortTime }}</span>
                      <span v-if="item.status==110">清关时间：{{item.clearanceTime }}</span>
                      <span v-if="item.status==120">清关放行时间：{{item.clearanceReleaseTime }}</span>
                      <span v-if="item.status==130">到仓时间：{{item.arrivalStockTime }}</span>
                      <span v-if="item.status==140">派送时间：{{item.dispatchTime }}</span>
                      <span v-if="item.status==888">签收时间：{{item.signTime }}</span>
                    </div>
                  </template>
                </el-table-column>
                 <el-table-column align="center"  label="件数">
                  <template slot-scope="scope">
                    <div v-for="item in mergeWaybillMap[scope.row.id].allSingleWaybills">
                      <span>{{item.inStockTotalPackages }}</span>
                    </div>
                  </template>
                </el-table-column>
                 <el-table-column align="center"  label="仓库代码">
                  <template slot-scope="scope">
                    <div v-for="item in mergeWaybillMap[scope.row.id].allSingleWaybills">
                      <span>{{item.dispatchAddressCode }}</span>
                    </div>
                  </template>
                </el-table-column>
                 <el-table-column align="center"  label="派送方式">
                  <template slot-scope="scope">
                    <div v-for="item in mergeWaybillMap[scope.row.id].allSingleWaybills">
                      <span v-if="item.trackNumber">{{item.trackNumber}}</span>
                      <span v-else>卡车派送</span>
                    </div>
                  </template>
                </el-table-column>
                 <el-table-column align="center"  fixed="right" label="保存" width="100" >
                  <template slot-scope="scope">
                    <a><i class="el-icon-success" @click="saveMergeScope(scope.row)" style="font-size:20px"></i></a>
                  </template>
                </el-table-column>
              </el-table>
            </el-main>
            <el-footer>
              <el-pagination
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange"
                :current-page="currentPage"
                :page-sizes="[10, 20, 30, 40, 50]"
                :page-size="pageSize"
                layout="total, sizes, prev, pager, next, jumper"
                :total="pageTotal"
              >
              </el-pagination>
            </el-footer>
          </div>
        </el-tab-pane>
        <el-tab-pane label="提取" name="140" :lazy="true">
          <div>
            <el-main>
              <el-table :data="extractWaybills" style="width: 100%" size="mini"
                        :header-cell-style="{'text-align':'center'}">
                 <el-table-column align="center"  prop="waybillNo" label="合单号">
                </el-table-column>
                 <el-table-column align="center"  prop="masterNumber" label="M单号">
                </el-table-column>
                 <el-table-column align="center"  prop="inStockChannel" label="渠道">
                  <template slot-scope="scope">
                    <span>{{ instockChannelMap[scope.row.inStockChannel] }}</span>
                  </template>
                </el-table-column>
                 <el-table-column align="center"  prop="inStockChannel" label="状态">
                  <template slot-scope="scope">
                    <span>{{ m(statusMap[scope.row.status]) }}</span>
                  </template>
                </el-table-column>
                 <el-table-column align="center"   label="提取时间"  :render-header="renderHeader">
                  <template slot-scope="scope">
                    <el-popover
                      placement="top"
                      width="400"
                      trigger="click">
                      <el-date-picker
                        size="mini"
                        v-model="scope.row.dispatchTime"
                        type="date"
                        placeholder="请选择日期"
                        value-format="yyyy-MM-dd"
                      >
                      </el-date-picker>
                      <span v-if="scope.row.dispatchTime" slot="reference">{{ scope.row.dispatchTime }}</span>
                      <span v-else  slot="reference">___</span>
                    </el-popover>
                  </template>
                </el-table-column>
                 <el-table-column align="center"  label="分单号">
                  <template slot-scope="scope">
                    <div v-for="item in mergeWaybillMap[scope.row.id].allSingleWaybills">
                      <span>{{item.waybillSingleNo}}</span>
                    </div>
                  </template>
                </el-table-column>
                 <el-table-column align="center"  label="运单号">
                  <template slot-scope="scope">
                    <div v-for="item in mergeWaybillMap[scope.row.id].allSingleWaybills">
                      <span>{{item.waybillNo}}</span>
                    </div>
                  </template>
                </el-table-column>
                <el-table-column align="center" label="选择" >
                  <template slot-scope="scope">
                    <div  v-for="item in mergeWaybillMap[scope.row.id].allSingleWaybills" style="line-height: 22px">
                      <el-checkbox v-model="item.checked" @change="handleChecked($event, item)"></el-checkbox>
                    </div>
                  </template>
                </el-table-column>
                 <el-table-column align="center"  label="当前状态">
                  <template slot-scope="scope">
                    <div v-for="item in mergeWaybillMap[scope.row.id].allSingleWaybills">
                      <span>{{m(statusMap[item.status]) }}</span>
                    </div>
                  </template>
                </el-table-column>
                 <el-table-column align="center"  label="上一个轨迹时间"  width="200">
                  <template slot-scope="scope">
                    <div v-for="item in mergeWaybillMap[scope.row.id].allSingleWaybills">
                      <span v-if="item.status==105">到港时间：{{item.arrivalPortTime }}</span>
                      <span v-if="item.status==110">清关时间：{{item.clearanceTime }}</span>
                      <span v-if="item.status==120">清关放行时间：{{item.clearanceReleaseTime }}</span>
                      <span v-if="item.status==130">到仓时间：{{item.arrivalStockTime }}</span>
                      <span v-if="item.status==140">派送时间：{{item.dispatchTime }}</span>
                      <span v-if="item.status==888">签收时间：{{item.signTime }}</span>
                    </div>
                  </template>
                </el-table-column>
                 <el-table-column align="center"  label="件数">
                  <template slot-scope="scope">
                    <div v-for="item in mergeWaybillMap[scope.row.id].allSingleWaybills">
                      <span>{{item.inStockTotalPackages }}</span>
                    </div>
                  </template>
                </el-table-column>
                 <el-table-column align="center"  label="仓库代码">
                  <template slot-scope="scope">
                    <div v-for="item in mergeWaybillMap[scope.row.id].allSingleWaybills">
                      <span>{{item.dispatchAddressCode }}</span>
                    </div>
                  </template>
                </el-table-column>
                 <el-table-column align="center"  label="派送方式">
                  <template slot-scope="scope">
                    <div v-for="item in mergeWaybillMap[scope.row.id].allSingleWaybills">
                      <span v-if="item.trackNumber">{{item.trackNumber}}</span>
                      <span v-else>卡车派送</span>
                    </div>
                  </template>
                </el-table-column>
                 <el-table-column align="center"  fixed="right" label="保存" width="100" >
                  <template slot-scope="scope">
                    <a><i class="el-icon-success" @click="saveMergeScope(scope.row)" style="font-size:20px"></i></a>
                  </template>
                </el-table-column>
              </el-table>
            </el-main>
            <el-footer>
              <el-pagination
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange"
                :current-page="currentPage"
                :page-sizes="[10, 20, 30, 40, 50]"
                :page-size="pageSize"
                layout="total, sizes, prev, pager, next, jumper"
                :total="pageTotal"
              >
              </el-pagination>
            </el-footer>
          </div>
        </el-tab-pane>
        <el-tab-pane label="签收" name="150" :lazy="true">
          <div>
            <el-main>
              <el-table :data="signedWaybills" style="width: 100%" size="mini"
                        :header-cell-style="{'text-align':'center'}">
                 <el-table-column align="center"  prop="waybillNo" label="合单号">
                </el-table-column>
                 <el-table-column align="center"  prop="masterNumber" label="M单号">
                </el-table-column>
                 <el-table-column align="center"  prop="inStockChannel" label="渠道">
                  <template slot-scope="scope">
                    <span>{{ instockChannelMap[scope.row.inStockChannel] }}</span>
                  </template>
                </el-table-column>
                 <el-table-column align="center"  prop="inStockChannel" label="状态">
                  <template slot-scope="scope">
                    <span>{{ m(statusMap[scope.row.status]) }}</span>
                  </template>
                </el-table-column>
                 <el-table-column align="center"   label="签收时间"  :render-header="renderHeader">
                  <template slot-scope="scope">
                    <el-popover
                      placement="top"
                      width="400"
                      trigger="click">
                      <el-date-picker
                        size="mini"
                        v-model="scope.row.signTime"
                        type="date"
                        placeholder="请选择日期"
                        value-format="yyyy-MM-dd"
                      >
                      </el-date-picker>
                      <span v-if="scope.row.signTime" slot="reference">{{ scope.row.signTime }}</span>
                      <span v-else  slot="reference">___</span>
                    </el-popover>
                  </template>
                </el-table-column>
                 <el-table-column align="center"  label="分单号">
                  <template slot-scope="scope">
                    <div v-for="item in mergeWaybillMap[scope.row.id].allSingleWaybills">
                      <span>{{item.waybillSingleNo}}</span>
                    </div>
                  </template>
                </el-table-column>
                 <el-table-column align="center"  label="运单号">
                  <template slot-scope="scope">
                    <div v-for="item in mergeWaybillMap[scope.row.id].allSingleWaybills">
                      <span>{{item.waybillNo}}</span>
                    </div>
                  </template>
                </el-table-column>
                <el-table-column align="center" label="选择" width="50">
                  <template slot-scope="scope">
                    <div  v-for="item in mergeWaybillMap[scope.row.id].allSingleWaybills" style="line-height: 22px">
                      <el-checkbox v-model="item.checked" @change="handleChecked($event, item)"></el-checkbox>
                    </div>
                  </template>
                </el-table-column>
                 <el-table-column align="center"  label="当前状态">
                  <template slot-scope="scope">
                    <div v-for="item in mergeWaybillMap[scope.row.id].allSingleWaybills">
                      <span>{{m(statusMap[item.status]) }}</span>
                    </div>
                  </template>
                </el-table-column>
                 <el-table-column align="center"  label="上一个轨迹时间"  width="200">
                  <template slot-scope="scope">
                    <div v-for="item in mergeWaybillMap[scope.row.id].allSingleWaybills">
                      <span v-if="item.status==105">到港时间：{{item.arrivalPortTime }}</span>
                      <span v-if="item.status==110">清关时间：{{item.clearanceTime }}</span>
                      <span v-if="item.status==120">清关放行时间：{{item.clearanceReleaseTime }}</span>
                      <span v-if="item.status==130">到仓时间：{{item.arrivalStockTime }}</span>
                      <span v-if="item.status==140">派送时间：{{item.dispatchTime }}</span>
                      <span v-if="item.status==888">签收时间：{{item.signTime }}</span>
                    </div>
                  </template>
                </el-table-column>
                 <el-table-column align="center"  label="件数">
                  <template slot-scope="scope">
                    <div v-for="item in mergeWaybillMap[scope.row.id].allSingleWaybills">
                      <span>{{item.inStockTotalPackages }}</span>
                    </div>
                  </template>
                </el-table-column>
                 <el-table-column align="center"  label="仓库代码">
                  <template slot-scope="scope">
                    <div v-for="item in mergeWaybillMap[scope.row.id].allSingleWaybills">
                      <span>{{item.dispatchAddressCode }}</span>
                    </div>
                  </template>
                </el-table-column>
                 <el-table-column align="center"  label="派送方式">
                  <template slot-scope="scope">
                    <div v-for="item in mergeWaybillMap[scope.row.id].allSingleWaybills">
                      <span v-if="item.trackNumber">{{item.trackNumber}}</span>
                      <span v-else>卡车派送</span>
                    </div>
                  </template>
                </el-table-column>
                 <el-table-column align="center"  fixed="right" label="保存" width="100" >
                  <template slot-scope="scope">
                    <a><i class="el-icon-success" @click="saveMergeScope(scope.row)" style="font-size:20px"></i></a>
                  </template>
                </el-table-column>
              </el-table>
            </el-main>
            <el-footer>
              <el-pagination
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange"
                :current-page="currentPage"
                :page-sizes="[10, 20, 30, 40, 50]"
                :page-size="pageSize"
                layout="total, sizes, prev, pager, next, jumper"
                :total="pageTotal"
              >
              </el-pagination>
            </el-footer>
          </div>
        </el-tab-pane>
      </el-tabs>
    </el-card>
    <WaybillTodoUploadfile
      ref="WaybillTodoUploadfile"
      :data="this.uploadWaybill"
      :fileTypeOptions="fileTypeMap"
    ></WaybillTodoUploadfile>
    <el-dialog  title="新增" :visible.sync="showDialog" width="30%">
      <el-form :model="saveRemarkData"
               size="mini" label-width="100px">
        <el-form-item label="备注" prop="sysRemark">
          <el-input v-model="saveRemarkData.sysRemark" type="text" ></el-input>
        </el-form-item>
        <el-form-item label="通知人" prop="receiveType" placeholder="多选">
          <el-select v-model="saveRemarkData.receiveType" multiple>
            <el-option value="0" label="销售"></el-option>
            <el-option value="1" label="客服"></el-option>
          </el-select>

        </el-form-item>
        <el-form-item label="消息类型:" prop="urgencytype">
          <el-radio-group v-model="saveRemarkData.urgencytype" size="medium">
            <el-radio
              v-for="(item, index) in urgencytypeOptions"
              :key="index"
              :label="item.value"
              :disabled="item.disabled"
            >{{ item.label }}
            </el-radio
            >
          </el-radio-group>
        </el-form-item>
        <el-form-item label="" >
          <el-button type="primary" size="mini" @click="saveSysRemark()">
            保存
          </el-button>
        </el-form-item>
      </el-form>
    </el-dialog>
    <el-dialog  title="批量录入（输入框失去焦点自动保存，下拉选择自动保存）" :visible.sync="batchUpdateDialog" width="50%">
      <el-tabs   type="border-card"   v-model="activeName">
        <el-tab-pane label="起|目|中港口" name="first">
          <el-form :model="param1" size="mini" label-width="100px">
            <el-form-item label="起运港" prop="shipmentPort" >
              <el-select
                v-model="param1.shipmentPort"
                placeholder="请选择起运港"
                clearable
                :style="{ width: '100%' }"
                filterable
                @change="handleSelectChange('shipmentPort',param1.shipmentPort)"
              >
                <el-option
                  v-for="(k, v) in configPortOptions"
                  :key="k"
                  :label="configPortOptions[v]"
                  :value="parseInt(v)"
                ></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="中转港" prop="transferPort" >
              <el-select
                v-model="param1.transferPort"
                placeholder="请选择中转港"
                clearable
                :style="{ width: '100%' }"
                filterable
                @change="handleSelectChange('transferPort',param1.transferPort)"
              >
                <el-option
                  v-for="(k, v) in configPortOptions"
                  :key="k"
                  :label="configPortOptions[v]"
                  :value="parseInt(v)"
                ></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="目的港" prop="destinationPort" >
              <el-select
                v-model="param1.destinationPort"
                placeholder="请选择目的港"
                clearable
                :style="{ width: '100%' }"
                filterable
                @change="handleSelectChange('destinationPort',param1.destinationPort)"
              >
                <el-option
                  v-for="(k, v) in configPortOptions"
                  :key="k"
                  :label="configPortOptions[v]"
                  :value="parseInt(v)"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-form>
        </el-tab-pane>
        <el-tab-pane label="件毛体" name="second">
          <el-form :model="param2"
                   size="mini" label-width="100px">
            <el-form-item label="件数" prop="serviceTotalPackages" >
              <el-input type="text" v-model="param2.serviceTotalPackages"  style="float: right;"
                        @blur="handleSelectChange('serviceTotalPackages',param2.serviceTotalPackages)"></el-input>
            </el-form-item>
            <el-form-item label="实重" prop="serviceActualWeight" >
              <el-input type="text" v-model="param2.serviceActualWeight" style="float: right;"
                        @blur="handleSelectChange('serviceActualWeight',param2.serviceActualWeight)"></el-input>
            </el-form-item>
            <el-form-item label="件数" prop="serviceChargedWeight" >
              <el-input type="text" v-model="param2.serviceChargedWeight" style="float: right;"
                        @blur="handleSelectChange('serviceChargedWeight',param2.serviceChargedWeight)"></el-input>
            </el-form-item>
            <el-form-item label="件数" prop="serviceVolume" >
              <el-input type="text" v-model="param2.serviceVolume" style="float: right;"
                        @blur="handleSelectChange('serviceVolume',param2.serviceVolume)"></el-input>
            </el-form-item>
          </el-form>
        </el-tab-pane>
        <el-tab-pane label="单价" name="third">
          <el-form :model="param3"
                   size="mini" label-width="100px">
            <el-form-item label="服务商单价" prop="serviceUnitPrice" >
              <el-input type="text" v-model="param3.serviceUnitPrice"  style="float: right;"
                        @blur="handleSelectChange('serviceUnitPrice',param3.serviceUnitPrice)"></el-input>
            </el-form-item>
            <el-form-item label="服务商币种" prop="serviceUnitPriceCurrency" >
              <el-select v-model="param3.serviceUnitPriceCurrency" filterable clearable
                         @change="handleSelectChange('serviceUnitPriceCurrency',param3.serviceUnitPriceCurrency)">
                <el-option
                  v-for="(item, value) in currencyMap"
                  :key="value"
                  :value="value"
                  :label="item"
                >
                </el-option>
              </el-select>
            </el-form-item>
          </el-form>
        </el-tab-pane>
        <el-tab-pane label="航空公司" name="fourth">
          <el-form :model="param4"
                   size="mini" label-width="100px">
            <el-form-item label="航司" prop="shipOrAirlineCompany" >
              <el-select
                v-model="param4.shipOrAirlineCompany"
                placeholder="请选择航司"
                clearable
                :style="{ width: '100%' }"
                filterable
                @change="handleSelectChange('shipOrAirlineCompany',param4.shipOrAirlineCompany)"
              >
                <el-option
                  v-for="(item, value) in configAirlineMap"
                  :key="value"
                  :label="item"
                  :value="parseInt(value)"
                ></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="航班号" prop="flightNumber" >
              <el-input type="text" v-model="param4.flightNumber"  style="float: right;"
                        @blur="handleSelectChange('flightNumber',param4.flightNumber)"></el-input>
            </el-form-item>
          </el-form>
        </el-tab-pane>
        <el-tab-pane label="英文品名" name="fifth">
          <el-form :model="param5"
                   size="mini" label-width="100px">
            <el-form-item label="英文品名" prop="nameDescription" >
              <el-input
                type="textarea"
                :autosize="{ minRows: 7, maxRows: 12 }"
                v-model="param5.nameDescription"
                style="float: right"
                @blur="handleSelectChange('nameDescription',param5.nameDescription)"
              ></el-input>
            </el-form-item>
          </el-form>
        </el-tab-pane>
        <el-tab-pane label="Shipper" name="sixth">
          <el-form :model="param6"
                   size="mini" label-width="100px">
            <el-form-item label="Shipper" prop="masterNumberSender" >
              <el-select
                filterable
                clearable
                v-model="param6.masterNumberSenderS"
                placeholder="请输入内容"
                size="mini"
              >
                <el-option
                  v-for="item in servicerMapList"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                  @click.native="selectSenderF('masterNumberSender',item.value,param6)"
                >
                </el-option>
              </el-select>
              <el-input
                type="textarea"
                :autosize="{ minRows: 7, maxRows: 12 }"
                v-model="param6.masterNumberSender"
                style="float: right"
              ></el-input>
            </el-form-item>
          </el-form>
        </el-tab-pane>
        <el-tab-pane label="Consignee" name="seventh">
          <el-form :model="param7"
                   size="mini" label-width="100px">
            <el-form-item label="Consignee" prop="masterNumberReceiver" >
              <el-select
                filterable
                clearable
                v-model="param7.masterNumberReceiverS"
                placeholder="请输入内容"
                size="mini"
              >
                <el-option
                  v-for="item in servicerMapList"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                  @click.native="selectSenderF('masterNumberReceiver',item.value,param7)"
                >
                </el-option>
              </el-select>
              <el-input
                type="textarea"
                :autosize="{ minRows: 7, maxRows: 12 }"
                v-model="param7.masterNumberReceiver"
                style="float: right"
              ></el-input>
            </el-form-item>
          </el-form>
        </el-tab-pane>
        <el-tab-pane label="Notify Party" name="eighth">
          <el-form :model="param8"
                   size="mini" label-width="100px">
            <el-form-item label="Notify Party" prop="masterNumberNotifier" >
              <el-select
                filterable
                clearable
                v-model="param8.masterNumberNotifierS"
                placeholder="请输入内容"
                size="mini"
              >
                <el-option
                  v-for="item in servicerMapList"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                  @click.native="selectSenderF('masterNumberNotifier',item.value,param8)"
                >
                </el-option>
              </el-select>
              <el-input
                type="textarea"
                :autosize="{ minRows: 7, maxRows: 12 }"
                v-model="param8.masterNumberNotifier"
                style="float: right"
              ></el-input>
            </el-form-item>
          </el-form>
        </el-tab-pane>
      </el-tabs>
    </el-dialog>
    <el-dialog  title="批量录入" :visible.sync="inStockTimeDialog" width="40%">
      <el-form :model="param9"
               size="mini" label-width="100px">
        <el-form-item label="入库时间:" prop="inStockTime">
          <el-date-picker
            size="mini"
            v-model="param9.inStockTime"
            type="date"
            placeholder="请选择日期"
            value-format="yyyy-MM-dd"
            @change="handleSelectChange('inStockTime',param9.inStockTime)"
          >
          </el-date-picker>
        </el-form-item>
      </el-form>
    </el-dialog>
    <el-dialog  title="批量录入" :visible.sync="outStockTimeDialog" width="40%">
      <el-form :model="param10"
               size="mini" label-width="100px">
        <el-form-item label="出库时间:" prop="inStockTime">
          <el-date-picker
            size="mini"
            v-model="param10.outStockTime"
            type="date"
            placeholder="请选择日期"
            value-format="yyyy-MM-dd"
            @change="handleSelectChange('outStockTime',param10.outStockTime)"
          >
          </el-date-picker>
        </el-form-item>
      </el-form>
    </el-dialog>
    <el-dialog  title="录入清关放行时间" :visible.sync="clearanceReleaseTimeDialog" width="40%">
      <el-form :model="param11"
               size="mini" label-width="100px">
        <el-form-item label="清关放行时间:" prop="inStockTime">
          <el-date-picker
            size="mini"
            v-model="param11.clearanceReleaseTime"
            type="date"
            placeholder="请选择日期"
            value-format="yyyy-MM-dd"
            @change="handleSelectChange('clearanceReleaseTime',param11.clearanceReleaseTime)"
          >
          </el-date-picker>
        </el-form-item>
      </el-form>
    </el-dialog>
    <el-dialog  title="录入查验信息" :visible.sync="inspectionInfoDialog" width="40%">
      <el-form :model="param12"
               size="mini" label-width="100px">
        <el-form-item label="清关查验时间:" prop="arrivalPortInspectionTime">
          <el-date-picker
            size="mini"
            v-model="param12.arrivalPortInspectionTime"
            type="date"
            placeholder="请选择日期"
            value-format="yyyy-MM-dd"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="清关查验原因:" prop="arrivalPortInspectionReason">
          <el-input
            type="text"
            maxlength="30"
            v-model="param12.arrivalPortInspectionReason"
            style="float: right"
          ></el-input>
        </el-form-item>
        <el-form-item label="是否通知客户:" prop="notify">
          <el-radio-group v-model="param12.notify" size="medium">
            <el-radio :label="parseInt(1)">是</el-radio>
            <el-radio :label="parseInt(0)">否</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="" >
          <el-button type="primary" size="mini" @click="saveInputInspectionReason(param12)">
            保存
          </el-button>
        </el-form-item>
      </el-form>
    </el-dialog>
    <el-dialog  title="录入到仓时间" :visible.sync="arrivalStockTimeDialog" width="40%">
      <el-form :model="param14"
               size="mini" label-width="100px">
        <el-form-item label="到仓时间:" prop="arrivalStockTime">
          <el-date-picker
            size="mini"
            v-model="param14.arrivalStockTime"
            type="date"
            placeholder="请选择日期"
            value-format="yyyy-MM-dd"
            @change="handleSelectChange('arrivalStockTime',param14.arrivalStockTime)"
          >
          </el-date-picker>
        </el-form-item>
      </el-form>
    </el-dialog>
    <el-dialog  title="录入提取时间" :visible.sync="dispatchTimeDialog" width="40%">
      <el-form :model="param15"
               size="mini" label-width="100px">
        <el-form-item label="提取时间:" prop="dispatchTime">
          <el-date-picker
            size="mini"
            v-model="param15.dispatchTime"
            type="date"
            placeholder="请选择日期"
            value-format="yyyy-MM-dd"
            @change="handleSelectChange('dispatchTime',param15.dispatchTime)"
          >
          </el-date-picker>
        </el-form-item>
      </el-form>
    </el-dialog>
    <el-dialog  title="录入签收时间" :visible.sync="signTimeDialog" width="40%">
      <el-form :model="param16"
               size="mini" label-width="100px">
        <el-form-item label="签收时间:" prop="signTime">
          <el-date-picker
            size="mini"
            v-model="param16.signTime"
            type="date"
            placeholder="请选择日期"
            value-format="yyyy-MM-dd"
            @change="handleSelectChange('signTime',param16.signTime)"
          >
          </el-date-picker>
        </el-form-item>
      </el-form>
    </el-dialog>
  </div>
</template>
<script>
import { ajax } from "@/store/yg/common/utils";
import axios from "axios";
import * as constant from "@/store/yg/common/constant";
const WaybillTodoUploadfile = () => import("./WaybillTodoUploadfile");
import { m } from "@/store/yg/common/local";

export default {
  components: {
    WaybillTodoUploadfile
  },
  props: [],
  data() {
    return {
      activeName: 'first',
      showDialog: false,
      searchCriteria: {
        waybillMergeNos: '',
        waybillNos: '',
        waybillSingleNos: '',
        masterNumbers: '',
        destinationPort: '',
        serviceCompanyId: '',
        operationId: '',
        shipmentPort: '',
        customsClearanceAgent: '',
        overseasOperatorIds: '',
        dispatchAddressCode: '',
        vat: '',
        eori: '',
        affairsStatue: '',
        orderType: 1,
        queryType: 0,
        currentPage: "",
        pageTotal: '',
        pageSize: '',
      },
      waybillFileId: "",
      currentPage: 1,
      pageTotal: 0,
      pageSize: 10,
      bookingWaybills: [],
      putTankWaybills: [],
      outStockWaybills: [],
      feedingWaybills: [],
      clearanceWaybills: [],
      customsClearanceWaybills: [],
      warehousingWaybills: [],
      customsClearanceDocumentWaybills: [],
      forecastFileWaybills: [],
      concreteDataWaybills: [],
      leavePortWaybills: [],
      arrivalPortWaybills: [],
      customsLiquidationWaybills: [],
      customsClearanceAndReleaseWaybills: [],
      arrivalStockWaybills: [],
      extractWaybills: [],
      signedWaybills: [],
      mergeWaybillMap: {},
      //服务商
      servicerMap: {},
      servicerMapList: {},
      servicerMapList1: {},
      //港口下拉
      configPortOptions: {},
      operationIdsOptions: {},
      shippingfbastockMap: {},
      countryMap: {},
      instockChannelMap: {},
      currencyMap: {},
      userMap: {},
      fileTypeMap: {},
      statusMap: {},
      waybillDispartCodeMap: {},
      queryTypeString: "切换为全局搜索",
      boosyn: true,
      visible: true,
      configAirlineMap: '',
      isbooking: false,
      isoutStock: false,
      isfeeding: false,
      isclearance: false,
      iscustomsClearanceAndRelease: false,
      iswarehousing: false,
      isarrivalStock: false,
      isextract: false,
      issigned: false,
      batchUpdateDialog: false,
      inStockTimeDialog: false,
      outStockTimeDialog: false,
      clearanceReleaseTimeDialog: false,
      inspectionInfoDialog: false,
      arrivalStockTimeDialog: false,
      dispatchTimeDialog: false,
      signTimeDialog: false,
      loading: false,
      masterNumberSender: [],
      masterNumberReceiver: [],
      masterNumberNotifier: [],
      masterNumberAgent: [],
      multipleSelection: [],
      tabStatus: '',
      waybillFileIdMap: {},
      uploadWaybill: {},
      mergeWaybillFiles: {},
      waybillIds:[],
      params: [],
      param1: '',
      param2: '',
      param3: '',
      param4: '',
      param5: '',
      param6: '',
      param7: '',
      param8: '',
      param9: '',
      param10: '',
      param11: '',
      param12: '',
      param13: '',
      param14: '',
      param15: '',
      param16: '',
      saveRemarkData: {
        waybillLoadId: '',
        sysRemark: '',
        receiveType: [],
        urgencytype: '',
      },
      urgencytypeOptions: [
        {
          label: "红",
          value: 0
        },
        {
          label: "黄",
          value: 1
        },
        {
          label: "灰",
          value: 2
        }
      ],
      receiveTypeOptions: [
        {
          label: "销售",
          value: 0
        },
        {
          label: "客服",
          value: 1
        }
      ],
      receiveType: [],
    };
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {
    this.initWaybillTodoListSource();
  },
  methods: {
    async initWaybillTodoListSource(){
      ajax("initWaybillTodoListSource", {}).then(
        res => {
          console.log(res);
          if (res.code == 200) {
            var data  = res.data;
            this.servicerMap = data.servicerMap;
            this.servicerMapList = data.servicerMapList;
            this.configPortOptions=data.configPortMap;
            this.userMap=data.userMap;
            this.shippingfbastockMap=data.fbaStockMap;
            this.countryMap=data.countryMap;
            this.instockChannelMap=data.channelMap ;
            this.configAirlineMap = data.configAirlineMap;
            this.fileTypeMap = data.fileTypeMap;
            this.currencyMap = data.currencyMap;
            this.statusMap = data.statusMap;
          }else{
            this.$message.error(res.message);
          }
        },
        error => {
          console.log(error);
        }
      );
    },
    m(k) {
      return m(k);
    },
    async searchTaybillTodoList() {
      this.searchCriteria.orderType = 1;
      this.loading = true;
      this.searchCriteria.currentPage = this.currentPage
      this.searchCriteria.pageTotal = this.pageTotal;
      this.searchCriteria.pageSize = this.pageSize;
      ajax("toAirWaybillToDoList", this.searchCriteria).then(
        res => {
          this.loading = false;
          console.log(res);
          if (res.code == 200) {
            var data  = res.data;
            this.mergeWaybillMap = data.mergeWaybillMap;
            this.waybillFileIdMap = data.waybillFileIdMap;
            this.pageTotal = data.pageTotal;
            this.mergeWaybillFiles = data.mergeWaybillFiles;
            this.waybillDispartCodeMap = data.waybillDispartCodeMap;
            if (this.searchCriteria.affairsStatue==10) {
              this.bookingWaybills = data.waybills;
            } else if (this.searchCriteria.affairsStatue==20){
              this.putTankWaybills = data.waybills;
            } else if (this.searchCriteria.affairsStatue==30){
              this.outStockWaybills = data.waybills;
            } else if (this.searchCriteria.affairsStatue==40){
              this.feedingWaybills = data.waybills;
            } else if (this.searchCriteria.affairsStatue==50){
              this.clearanceWaybills = data.waybills;
            } else if (this.searchCriteria.affairsStatue==60){
              this.customsClearanceWaybills = data.waybills;
            } else if (this.searchCriteria.affairsStatue==70){
              this.warehousingWaybills = data.waybills;
            } else if (this.searchCriteria.affairsStatue==80){
              this.customsClearanceDocumentWaybills = data.waybills;
            } else if (this.searchCriteria.affairsStatue==90){
              this.forecastFileWaybills = data.waybills;
            } else if (this.searchCriteria.affairsStatue==100){
              this.concreteDataWaybills = data.waybills;
            } else if (this.searchCriteria.affairsStatue==105){
              this.leavePortWaybills = data.waybills;
            } else if (this.searchCriteria.affairsStatue==110){
              this.arrivalPortWaybills = data.waybills;
            } else if (this.searchCriteria.affairsStatue==120){
              this.customsLiquidationWaybills = data.waybills;
            } else if (this.searchCriteria.affairsStatue==130){
              this.customsClearanceAndReleaseWaybills = data.waybills;
            } else if (this.searchCriteria.affairsStatue==135){
              this.arrivalStockWaybills = data.waybills;
            } else if (this.searchCriteria.affairsStatue==140){
              this.extractWaybills = data.waybills;
            } else if (this.searchCriteria.affairsStatue==150){
              this.signedWaybills = data.waybills;
            }
          }else{
            this.$message.error(res.message);
          }
        },
        error => {
          console.log(error);
        }
      );
    },
    async previewBooking(id){
      ajax("exportBookingDocx", {id: id,status: 0}).then(
        res => {
          console.log("下載Booking", res);
          if (null != res.message && res.message != "") {
            this.$message.error(res.message);
          } else {
            var path = constant.FILE_SERVER + res.path;
            this.showFileUrl = 'https://view.officeapps.live.com/op/view.aspx?src=' + path;
            window.open(this.showFileUrl, '_blank');
          }
        },
        error => {
          console.log(error);
        }
      );
    },
    async exportBookingDocx(id){
      ajax("exportBookingDocx", {id: id,status: 0}).then(
        res => {
          console.log("下載Booking", res);
          if (null != res.message && res.message != "") {
            this.$message.error(res.message);
          } else {
            var path = constant.FILE_SERVER + res.path;
            location.href =
              constant.API_SERVER +
              "/open/downloadFileByHttp?fileName=" +
              res.fileName +
              "&path=" +
              path;
          }
        },
        error => {
          console.log(error);
        }
      );
    },
    reset(){
      this.searchCriteria = {};
      this.searchTaybillTodoList();
    },
    SearchWaybillBox(tab, event){
      this.resetData();
      this.tabStatus = tab.name;
      if(tab.name ==10){
        this.isbooking = true;
      } else  {
        this.isbooking = false;
      }
      if(tab.name ==30){
        this.isoutStock = true;
      } else  {
        this.isoutStock = false;
      }
      if(tab.name ==40){
        this.isfeeding = true;
      } else  {
        this.isfeeding = false;
      }
      if(tab.name ==50){
        this.isclearance = true;
      } else  {
        this.isclearance = false;
      }
      if(tab.name ==130){
        this.iscustomsClearanceAndRelease = true;
      } else  {
        this.iscustomsClearanceAndRelease = false;
      }
      if(tab.name ==135){
        this.isarrivalStock = true;
      } else  {
        this.isarrivalStock = false;
      }
      if(tab.name ==140){
        this.isextract = true;
      } else  {
        this.isextract = false;
      }
      if(tab.name ==150){
        this.issigned = true;
      } else  {
        this.issigned = false;
      }
      this.searchCriteria.affairsStatue = tab.name;
      this.searchTaybillTodoList();
    },
    changeQuery() {
      if(this.searchCriteria.queryType == 0){
        this.searchCriteria.queryType = 1;
        this.boosyn = false;
        this.queryTypeString = '切换为局部搜索';
      }else {
        this.searchCriteria.queryType = 0;
        this.boosyn = true;
        this.queryTypeString = '切换为全局搜索';
      }
    },
    async selectSenderM(type,id,index) {
      await ajax("queryServiceCompanyById", { id: id }).then(
        res => {
          if (res.code != 200) {
            this.$message.error(res.message);
          } else {
            if (null != res.data) {
              const html =
                res.data["companyNameEn"] +
                "\n" +
                res.data["companyAddressEn"] +
                "\n" +
                "TEL:" +
                res.data["firstContactPhone"] +
                "\n" +
                res.data["vatNumber"];
              this.feedingWaybills[index][type] = html;
            }
          }
        },
        error => {
          console.log(error);
        }
      );
    },
    async selectSenderE(type,id,index) {
      await ajax("queryServiceCompanyById", { id: id }).then(
        res => {
          if (res.code != 200) {
            this.$message.error(res.message);
          } else {
            if (null != res.data) {
              const html =
                res.data["companyNameEn"] +
                "\n" +
                res.data["companyAddressEn"] +
                "\n" +
                "TEL:" +
                res.data["firstContactPhone"] +
                "\n" +
                res.data["vatNumber"];
              this.bookingWaybills[index][type] = html;
            }
          }
        },
        error => {
          console.log(error);
        }
      );
    },
    async selectSenderF(type,id,data) {
      await ajax("queryServiceCompanyById", { id: id }).then(
        res => {
          if (res.code != 200) {
            this.$message.error(res.message);
          } else {
            if (null != res.data) {
              const html =
                res.data["companyNameEn"] +
                "\n" +
                res.data["companyAddressEn"] +
                "\n" +
                "TEL:" +
                res.data["firstContactPhone"] +
                "\n" +
                res.data["vatNumber"];
              data[type] = html;
              this.handleSelectChange(type,html)
            }
          }
        },
        error => {
          console.log(error);
        }
      );
    },
    synchronizedProductName(id,index) {
      var param = {};
      param["id"] = id;
      ajax("synchronizedProductName", param).then(
        res => {
          console.log(res);
          if (res.code != 200) {
            this.$message.error("合单无品名可同步");
          } else {
            if (null == res.data) {
              this.$message.error("合单无品名可同步");
            } else {
              this.feedingWaybills[index].nameDescription = res.data;
            }
          }
        },
        error => {
          console.log(error);
        }
      );
    },
    exportM(row){
      console.log(row);
      ajax("exportWaybillMergeMawb", {"id": row.id, "param1":row.shippingWay}).then(
        res => {
          console.log(res);
          if (res.code != 200) {
            if (null != res.message) {
              this.$message.error(m(res.message));
            } else {
              this.$message.error("系统错误!");
            }
          } else {
            var path = (path = constant.FILE_SERVER + res.data2);
            var fileUrl = path + res.data;
            console.log(fileUrl);
            window.open(fileUrl);
          }
        },
        error => {
          console.log(error);
        }
      );
    },
    previewM(){

    },
    showthis(val){
      console.log(val);
      this.servicerMapList1[val] = this.servicerMapList;
    },
    handleSizeChange(val) {
      this.pageSize = val;
      this.searchTaybillTodoList();
    },
    handleCurrentChange(val) {
      this.currentPage = val;
      this.searchTaybillTodoList();
    },
    saveMergeScope: function (val) {
      var updateArr = [];
      if (this.tabStatus == 10) {
        var param = {};
        param["id"] = val.id;
        param["inStockChannel"] = val.inStockChannel;
        param["countryId"] = val.countryId;
        param["masterNumber"] = val.masterNumber;
        param["serviceTotalPackages"] = val.serviceTotalPackages;
        param["serviceActualWeight"] = val.serviceActualWeight;
        param["serviceChargedWeight"] = val.serviceChargedWeight;
        param["serviceVolume"] = val.serviceVolume;
        param["shipmentPort"] = val.shipmentPort;
        param["transferPort"] = val.transferPort;
        param["destinationPort"] = val.destinationPort;
        param["shipOrAirlineCompany"] = val.shipOrAirlineCompany;
        param["flightNumber"] = val.flightNumber;
        param["leavePortTime"] = val.leavePortTime;
        param["arrivalPortTime"] = val.arrivalPortTime;
        param["operationId"] = val.operationId;
        param["nameDescription"] = val.nameDescription;
        param["masterNumberSender"] = val.masterNumberSender;
        param["serviceCompanyId"] = val.serviceCompanyId;
        updateArr.push(param);
      } else if (this.tabStatus == 20) {
        var param = {};
        param["id"] = val.id;
        param["shipOrAirlineCompany"] = val.shipOrAirlineCompany;
        param["flightNumber"] = val.flightNumber;
        param["leavePortTime"] = val.leavePortTime;
        param["arrivalPortTime"] = val.arrivalPortTime;
        updateArr.push(param);
      } else if (this.tabStatus == 30) {
        var param = {};
        param["id"] = val.id;
        param["inStockTime"] = val.inStockTime;
        param["outStockTime"] = val.outStockTime;
        updateArr.push(param);
      } else if (this.tabStatus == 40) {
        var param = {};
        param["id"] = val.id;
        param["masterNumberSender"] = val.masterNumberSender;
        param["masterNumberReceiver"] = val.masterNumberReceiver;
        param["masterNumberNotifier"] = val.masterNumberNotifier;
        param["masterNumberAgent"] = val.masterNumberAgent;
        param["nameDescription"] = val.nameDescription;
        updateArr.push(param);
      } else if (this.tabStatus == 50) {
        var param = {};
        param["id"] = val.id;
        param["declarationTime"] = val.declarationTime;
        updateArr.push(param);
      } else if (this.tabStatus == 60) {
        var param = {};
        param["id"] = val.id;
        param["permitThroughTime"] = val.permitThroughTime;
        param["departurePortInspectionTime"] = val.departurePortInspectionTime;
        param["departurePortInspectionReason"] = val.departurePortInspectionReason;
        updateArr.push(param);
      } else if (this.tabStatus == 70) {
        if (val){
          val.forEach(p => {
            var param = {};
            param["id"] = p.id;
            param["isPassToThePort"] = p.isPassToThePort;
            param["isProxyConfirmsReceiptGoods"] = p.isProxyConfirmsReceiptGoods;
            param["takeDeliveryNo1"] = p.takeDeliveryNo1;
            param["takeDeliveryNo2"] = p.takeDeliveryNo2;
            param["takeDeliveryNo3"] = p.takeDeliveryNo3;
            updateArr.push(param);
          });
        }
      }else if (this.tabStatus == 100) {
        var param = {};
        param["id"] = val.id;
        param["serviceTotalPackages"] = val.serviceTotalPackages;
        param["serviceActualWeight"] = val.serviceActualWeight;
        param["serviceChargedWeight"] = val.serviceChargedWeight;
        param["serviceVolume"] = val.serviceVolume;
        param["serviceVolumeWeight"] = val.serviceVolumeWeight;
        param["serviceUnitPrice"] = val.serviceUnitPrice;
        param["serviceUnitPriceCurrency"] = val.serviceUnitPriceCurrency;
        param["shipmentPort"] = val.shipmentPort;
        param["transferPort"] = val.transferPort;
        param["destinationPort"] = val.destinationPort;
        param["shipOrAirlineCompany"] = val.shipOrAirlineCompany;
        updateArr.push(param);
      } else if (this.tabStatus == 105){
        var param = {};
        param["id"] = val.id;
        param["leavePortTime"] = val.leavePortTime;
        updateArr.push(param);
      } else if (this.tabStatus == 110){
        var param = {};
        param["id"] = val.id;
        param["arrivalPortTime"] = val.arrivalPortTime;
        updateArr.push(param);
      } else if (this.tabStatus == 120){
        var param = {};
        param["id"] = val.id;
        param["clearanceTime"] = val.clearanceTime;
        updateArr.push(param);
      } else if (this.tabStatus == 130){
        var param = {};
        param["id"] = val.id;
        param["clearanceReleaseTime"] = val.clearanceReleaseTime;
        param["arrivalPortInspectionTime"] = val.arrivalPortInspectionTime;
        param["arrivalPortInspectionReason"] = val.arrivalPortInspectionReason;
        updateArr.push(param);
      } else if (this.tabStatus == 135){
        var param = {};
        param["id"] = val.id;
        param["arrivalStockTime"] = val.arrivalStockTime;
        updateArr.push(param);
      } else if (this.tabStatus == 140){
        var param = {};
        param["id"] = val.id;
        param["dispatchTime"] = val.dispatchTime;
        updateArr.push(param);
      } else if (this.tabStatus == 150){
        var param = {};
        param["id"] = val.id;
        param["signTime"] = val.signTime;
        updateArr.push(param);
      }
      if (updateArr.length===0){
        this.$message.error("没有数据");
        return;
      }
      this.$confirm("确认保存吗？")
        .then(_ => {
          ajax("saveMergeScope", updateArr
          ).then(
            res => {
              if (res.code === 200) {
                this.$message({
                  message: "已保存",
                  type: "success"
                });
              } else {
                this.$message.error(res.message);
              }
            },
            error => {
              console.log(error);
            }
          );
        })
        .catch(_ => {
        });
    },
    resetData(){
      this.multipleSelection = [];
      this.waybillIds = [];

      this.bookingWaybills = [];
      this.putTankWaybills = [];
      this.outStockWaybills = [];
      this.feedingWaybills = [];
      this.clearanceWaybills = [];
      this.customsClearanceWaybills = [];
      this.warehousingWaybills = [];
      this.customsClearanceDocumentWaybills = [];
      this.forecastFileWaybills = [];
      this.concreteDataWaybills = [];
      this.leavePortWaybills = [];
      this.arrivalPortWaybills = [];
      this.customsLiquidationWaybills = [];
      this.customsClearanceAndReleaseWaybills = [];
      this.arrivalStockWaybills = [];
      this.extractWaybills = [];
      this.signedWaybills = [];
      this.currentPage= 1;
      this.pageTotal= 0;
      this.pageSize= 10;
    },
    downLoadFile(url){
      var path = (path = constant.FILE_SERVER + "/tmp/");
      var fileUrl = path + url;
      console.log(fileUrl);
      window.open(fileUrl);
    },
    batchReportCustomerClearanceFile(waybills,type){
      var param = {};
      if (type ===0){
        if (this.waybillIds.length===0){
          this.$message.error("请先选择运单");
          return;
        }
        param["ids"] = this.waybillIds;
      } else if (type===1){
        var idsArr = [];
        waybills.forEach((item,index)=>{
          idsArr.push(item.id);
        })
        param["ids"] = idsArr;
      }
      ajax("batchReportCustomerClearanceFile",param).then(
        res => {
          console.log(res);
          if (res.message) {
            this.$message.error(m(res.message));
          } else {
            var path = constant.FILE_SERVER + res.path;
            location.href =
              constant.API_SERVER +
              "/open/downloadFileByHttp?fileName=" +
              res.fileName +
              "&path=" +
              path;
          }
        },
        error => {
          console.log(error);
        }
      );
    },
    createShipTrace(row,type){
      var arr = [];
      if (type ===1) {
        var param = {};
        if (!row.departurePortInspectionReason && this.tabStatus == 60) {
          this.$message.error("请先输入报关查验原因");
        }
        if (!row.arrivalPortInspectionReason && this.tabStatus == 130) {
          this.$message.error("请先输入报关查验原因");
        }
        if (this.tabStatus == 60) {
          param["track"] = row.departurePortInspectionReason;
        } else if (this.tabStatus == 130) {
          param["track"] = row.arrivalPortInspectionReason;
        }
        param["waybillId"] = row.id;
        param["status"] = row.status;
        param["isShow"] = 1;
        arr.push(param);
      } else if (type === 0){
        arr = this.params;
      } else {
        return;
      }
      this.$confirm("确认通知吗？")
        .then(_ => {
          ajax("createShipTraceWaybillTodo", {batchUpdateWaybills: arr}
          ).then(
            res => {
              if (res.code === 200) {
                this.$message({
                  message: "已通知",
                  type: "success"
                });
              } else {
                this.$message.error(res.message);
              }
            },
            error => {
              console.log(error);
            }
          );
        })
        .catch(_ => {});
    },
    toUploadfile(row) {
      this.uploadWaybill = row;
      this.$refs.WaybillTodoUploadfile.centerDialogVisible = true;
    },
    showRemarkForm(waybillId){
      this.showDialog = true;
      this.saveRemarkData.waybillLoadId = waybillId;
    },
    saveSysRemark(){
      if (!this.saveRemarkData.sysRemark) {
        this.$message.error("请填写备注信息");
        return;
      }
      ajax("saveSysRemark", this.saveRemarkData).then(
        res => {
          if (res.code != 200) {
            if (res.message) {
              this.$message.error(res.message);
            } else {
              this.$message.error("程序异常");
            }
          } else {
            this.$message.success("成功");
            this.showDialog = false;
          }
        },
        error => {
          this.$message.error("程序异常");
        }
      );
    },
    renderHeader(h, { column, $index }){
      return h('div', {
        attrs: {
          class: 'cell'  //ele原来样式
        },
        domProps: {
          innerHTML: '<span class="redClassType">'+column.label+'</span>'
        }
      })
    },
    handleSelectionChange(val) {
      this.waybillIds = [];
      this.multipleSelection = val;
      if (this.multipleSelection.length > 0) {
        this.multipleSelection.forEach(element => {
          if(this.waybillIds.indexOf(element.id)===-1) {
            this.waybillIds.push(element.id);
          }
        });
      }
      console.log(this.waybillIds);
    },
    handleSelectionChange1(val) {
      this.waybillIds = [];
      this.params = [];
      this.multipleSelection = val;
      if (this.multipleSelection.length > 0) {
        this.multipleSelection.forEach(element => {
          this.mergeWaybillMap[element.id].allSingleWaybills.forEach(p => {
            if(this.waybillIds.indexOf(p.id)===-1) {
              this.waybillIds.push(p.id);
              var param = {};
              param["waybillId"] = p.id;
              param["status"] = p.status;
              param["isShow"] = 1;
              this.params.push(param);
            }
          });
        });
      }
      console.log(this.waybillIds);
    },
    handleChecked(event, row){
      if (event){
        this.waybillIds.push(row.id);
        var param = {};
        param["waybillId"] = row.id;
        param["status"] = row.status;
        param["isShow"] = 1;
        this.params.push(param);
      } else {
        this.waybillIds.splice(this.waybillIds.indexOf(row.id),1);
        this.params.forEach(p => {
          if(p.waybillId == row.id){
            this.params.splice(this.params.indexOf(p),1);
          }
        });
      }
      console.log(this.params);
    },
    handleSelectionChange2(val) {
      this.waybillIds = [];
      this.multipleSelection = val;
      if (this.multipleSelection.length > 0) {
        this.multipleSelection.forEach(element => {
          this.mergeWaybillMap[element.id].markedSingleWaybills.forEach(p => {
            if(this.waybillIds.indexOf(p.id)===-1) {
              this.waybillIds.push(p.id);
            }
          });
        });
      }
      console.log(this.waybillIds);
    },
    batchReportWaybillBookings(){
      if (!this.waybillIds){
        this.$message.error("请先选择运单");
        return;
      }
      ajax("batchReportWaybillBookings", {"ids": this.waybillIds}).then(
        res => {
          if (res.code != 200) {
            if (res.message) {
              this.$message.error(res.message);
            } else {
              this.$message.error("程序异常");
            }
          } else {
            this.$message.success("成功");
          }
        },
        error => {
          this.$message.error("程序异常");
        }
      );
    },
    batchInputBookings(){
      if (this.waybillIds===0){
        this.$message.error("请先选择运单");
        return;
      }
      this.batchUpdateDialog = true;
    },
    inStockTimeDialogB(){
      if (this.waybillIds.length===0){
        this.$message.error("请先选择运单");
        return;
      }
      this.inStockTimeDialog = true;
    },
    outStockTimeDialogB(){
      if (this.waybillIds.length===0){
        this.$message.error("请先选择运单");
        return;
      }
      this.outStockTimeDialog = true;
    },
    batchPassToThePort(){
      if (this.waybillIds.length===0){
        this.$message.error("请先选择运单");
        return;
      }
      this.handleSelectChange("isPassToThePort",1);
    },
    batchConfirmsReceiptGoods(){
      if (this.waybillIds.length===0){
        this.$message.error("请先选择运单");
        return;
      }
      this.handleSelectChange("isProxyConfirmsReceiptGoods",1);
    },
    batchInputSingleWaybillTime(){
      if (this.waybillIds.length===0){
        this.$message.error("请先选择运单");
        return;
      }
      this.clearanceReleaseTimeDialog = true;
    },
    batchInputInspectionReason(){
      if (this.waybillIds.length===0){
        this.$message.error("请先选择运单");
        return;
      }
      this.inspectionInfoDialog = true;
    },
    batchInputArrivalStockTime(){
      if (this.waybillIds.length===0){
        this.$message.error("请先选择运单");
        return;
      }
      this.arrivalStockTimeDialog = true;
    },
    batchInputDispatchTime(){
      if (this.waybillIds.length===0){
        this.$message.error("请先选择运单");
        return;
      }
      this.dispatchTimeDialog = true;
    },
    batchInputSignTime(){
      if (this.waybillIds.length===0){
        this.$message.error("请先选择运单");
        return;
      }
      this.signTimeDialog = true;
    },
    saveInputInspectionReason(val){
      if (!val){
        return;
      }
      if (this.waybillIds.length>0){
        var updateArr = [];
        this.waybillIds.forEach(p => {
          val["id"] = p;
          updateArr.push(val);
        });
        ajax("saveMergeScope", updateArr
        ).then(
          res => {
            if (res.code === 200) {
              this.$message({
                message: "已保存",
                type: "success"
              });
              if(row.notify===1){
                this.params.forEach(p => {
                  p["track"] = val.arrivalPortInspectionReason;
                });
                this.createShipTrace('',0);
              }
            } else {
              this.$message.error(res.message);
            }
          },
          error => {
            console.log(error);
          }
        );
      }else{
        this.$message.error("请先选择运单");
      }
    },
    handleSelectChange(name,value){
      if (!value){
        return;
      }
      if (this.waybillIds.length>0){
        var updateArr = [];
        this.waybillIds.forEach(p => {
          var param = {};
          param["id"] = p;
          param[name] = value;
          updateArr.push(param);
        });
        ajax("saveMergeScope", updateArr
        ).then(
          res => {
            if (res.code === 200) {
              this.$message({
                message: "已保存",
                type: "success"
              });
            } else {
              this.$message.error(res.message);
            }
          },
          error => {
            console.log(error);
          }
        );
      }else{
        this.$message.error("请先选择运单");
      }
    },
  }
};
</script>
<style>
  .redClassType{
    color: #FF7575;
  }
</style>
